mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-08 18:51:19 +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 := g.corsMiddleware(g.cfg.router)
|
||||||
_ = corsMux
|
|
||||||
|
|
||||||
if g.cfg.apiMiddlewareEndpointFactory != nil && !g.cfg.apiMiddlewareEndpointFactory.IsNil() {
|
if g.cfg.apiMiddlewareEndpointFactory != nil && !g.cfg.apiMiddlewareEndpointFactory.IsNil() {
|
||||||
g.registerApiMiddleware()
|
g.registerApiMiddleware()
|
||||||
@ -116,13 +115,13 @@ func (g *Gateway) Start() {
|
|||||||
|
|
||||||
if g.cfg.muxHandler != nil {
|
if g.cfg.muxHandler != nil {
|
||||||
g.cfg.router.PathPrefix("/").HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
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{
|
g.server = &http.Server{
|
||||||
Addr: g.cfg.gatewayAddr,
|
Addr: g.cfg.gatewayAddr,
|
||||||
Handler: g.cfg.router,
|
Handler: corsMux,
|
||||||
}
|
}
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
|
Loading…
Reference in New Issue
Block a user