fix: cors handling again for not just OPTIONS request (#10025)

CORS is notorious requires specific headers to be
handled appropriately in request and response,
using cors package as part of handlerFunc() for
options method lacks the necessary control this
package needs to add headers.
This commit is contained in:
Harshavardhana
2020-07-12 10:56:57 -07:00
committed by GitHub
parent 3b9fbf80ad
commit 37c14207d6
3 changed files with 6 additions and 12 deletions

View File

@@ -267,7 +267,7 @@ func StartGateway(ctx *cli.Context, gw Gateway) {
}
httpServer := xhttp.NewServer([]string{globalCLIContext.Addr},
criticalErrorHandler{router}, getCert)
criticalErrorHandler{corsHandler(router)}, getCert)
httpServer.BaseContext = func(listener net.Listener) context.Context {
return GlobalContext
}