mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-22 19:40:37 +00:00
fix cors middleware (#9999)
Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
This commit is contained in:
parent
4b249607da
commit
d66edc9670
@ -108,7 +108,6 @@ func (g *Gateway) Start() {
|
||||
}
|
||||
|
||||
corsMux := g.corsMiddleware(g.cfg.router)
|
||||
_ = corsMux
|
||||
|
||||
if g.cfg.apiMiddlewareEndpointFactory != nil && !g.cfg.apiMiddlewareEndpointFactory.IsNil() {
|
||||
g.registerApiMiddleware()
|
||||
@ -116,13 +115,13 @@ func (g *Gateway) Start() {
|
||||
|
||||
if g.cfg.muxHandler != nil {
|
||||
g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
g.cfg.muxHandler(g.proxy, g.cfg.router.ServeHTTP, w, r)
|
||||
g.cfg.muxHandler(g.proxy, corsMux.ServeHTTP, w, r)
|
||||
})
|
||||
}
|
||||
|
||||
g.server = &http.Server{
|
||||
Addr: g.cfg.gatewayAddr,
|
||||
Handler: g.cfg.router,
|
||||
Handler: corsMux,
|
||||
}
|
||||
|
||||
go func() {
|
||||
|
Loading…
Reference in New Issue
Block a user