kopia lustrzana https://github.com/bugout-dev/moonstream
Merge pull request #800 from bugout-dev/fix-nb-cors-post
Fixed nodebalancer cors post supportpull/747/merge
commit
6e3ae7478d
|
@ -365,7 +365,7 @@ func corsMiddleware(next http.Handler) http.Handler {
|
|||
}
|
||||
}
|
||||
if r.Method == "OPTIONS" {
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET,OPTIONS")
|
||||
w.Header().Set("Access-Control-Allow-Methods", "GET,POST,OPTIONS")
|
||||
// Credentials are cookies, authorization headers, or TLS client certificates
|
||||
w.Header().Set("Access-Control-Allow-Credentials", "true")
|
||||
w.Header().Set("Access-Control-Allow-Headers", "Authorization")
|
||||
|
|
|
@ -226,7 +226,7 @@ func Server() {
|
|||
|
||||
// Set common middlewares, from bottom to top
|
||||
commonHandler := corsMiddleware(serveMux)
|
||||
commonHandler = logMiddleware(serveMux)
|
||||
commonHandler = logMiddleware(commonHandler)
|
||||
commonHandler = panicMiddleware(commonHandler)
|
||||
|
||||
server := http.Server{
|
||||
|
|
Ładowanie…
Reference in New Issue