This commit is contained in:
parent
a4416164cd
commit
4693b95f77
|
@ -45,6 +45,13 @@ func (h *microsubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
log.Println(r.URL.Query())
|
||||
log.Println(r.PostForm)
|
||||
|
||||
if r.Method == http.MethodOptions {
|
||||
w.Header().Add("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Add("Access-Control-Allow-Methods", "GET, POST")
|
||||
w.Header().Add("Access-Control-Allow-Headers", "Authorization")
|
||||
return
|
||||
}
|
||||
|
||||
if auth {
|
||||
authorization := r.Header.Get("Authorization")
|
||||
|
||||
|
@ -63,13 +70,6 @@ func (h *microsubHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}
|
||||
|
||||
if r.Method == http.MethodOptions {
|
||||
w.Header().Add("Access-Control-Allow-Origin", "*")
|
||||
w.Header().Add("Access-Control-Allow-Methods", "GET, POST")
|
||||
w.Header().Add("Access-Control-Allow-Headers", "Authorization")
|
||||
return
|
||||
}
|
||||
|
||||
if r.Method == http.MethodGet {
|
||||
values := r.URL.Query()
|
||||
action := values.Get("action")
|
||||
|
|
Loading…
Reference in New Issue
Block a user