fix
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Владимир Фёдоров 2024-10-05 00:49:48 +07:00
parent fda5a8d5b4
commit 236dd66cd0
1 changed files with 6 additions and 6 deletions

View File

@ -104,12 +104,12 @@ func main() {
func cors(h http.Handler) http.Handler { func cors(h http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) { return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
ua := r.Header.Get("User-Agent") // ua := r.Header.Get("User-Agent")
if !strings.HasPrefix(ua, "crabs") { // if !strings.HasPrefix(ua, "crabs") {
w.WriteHeader(403) // w.WriteHeader(403)
return // return
} // }
w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PATCH, DELETE") w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PATCH, DELETE")
w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, Authorization, ResponseType") w.Header().Set("Access-Control-Allow-Headers", "Accept, Content-Type, Content-Length, Accept-Encoding, Authorization, ResponseType")