Files
zurg/internal/handlers/options.go
2024-07-06 12:44:25 +02:00

15 lines
307 B
Go

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.Header().Set("dav", "1,2")
w.WriteHeader(http.StatusOK)
return
}
next.ServeHTTP(w, r)
})
}