Add basic auth and fix repair issues

This commit is contained in:
Ben Sarmiento
2024-01-09 16:53:12 +01:00
parent eb3f2785ce
commit 91f6d35831
7 changed files with 73 additions and 39 deletions

View File

@@ -0,0 +1,13 @@
package handlers
import "net/http"
func (hs *Handlers) options(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if r.Method == "OPTIONS" {
w.WriteHeader(http.StatusOK)
return
}
next.ServeHTTP(w, r)
})
}