14 lines
275 B
Go
14 lines
275 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.WriteHeader(http.StatusOK)
|
|
return
|
|
}
|
|
next.ServeHTTP(w, r)
|
|
})
|
|
}
|