Remove ServeMux implementation from openapi package.
Some checks failed
Go / build (push) Has been cancelled

The ServeMux code was unused and redundant, so it has been removed to streamline the codebase. This helps reduce complexity and ensures clarity in the repository's structure.
This commit is contained in:
2025-06-30 12:24:47 +01:00
parent bbebbe2b02
commit 87a10b5166

View File

@@ -1,29 +0,0 @@
package openapi
import (
"net/http"
"realy.lol/lol"
)
type ServeMux struct {
*http.ServeMux
}
func NewServeMux() (sm *ServeMux) {
lol.Tracer("NewServeMux")
defer func() { lol.Tracer("end NewServeMux", sm) }()
sm = &ServeMux{http.NewServeMux()}
return
}
func (c *ServeMux) ServeHTTP(w http.ResponseWriter, r *http.Request) {
lol.Tracer("ServeHTTP")
defer func() { lol.Tracer("end ServeHTTP") }()
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization")
if r.Method == http.MethodOptions {
return
}
c.ServeMux.ServeHTTP(w, r)
}