fix
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
fda5a8d5b4
commit
236dd66cd0
|
@ -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")
|
||||||
|
|
Loading…
Reference in New Issue