Skip to content

Commit

Permalink
fix(api): revert changes regarding Handler
Browse files Browse the repository at this point in the history
  • Loading branch information
gacevicljubisa committed Oct 23, 2024
1 parent cd145a3 commit 46bc6a0
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions pkg/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,23 @@ func (s *Service) Mount() {
s.mountBusinessDebug()
s.mountAPI()

s.Handler = web.ChainHandlers(
httpaccess.NewHTTPAccessLogHandler(s.logger, s.tracer, "api access"),
handlers.CompressHandler,
s.corsHandler,
web.NoCacheHeadersHandler,
web.FinalHandler(router),
)
}

// EnableFullAPI will enable all available endpoints, because some endpoints are not available during syncing.
func (s *Service) EnableFullAPI() {
if s == nil {
return
}

s.fullAPIEnabled = true

compressHandler := func(h http.Handler) http.Handler {
downloadEndpoints := []string{
"/bzz",
Expand Down Expand Up @@ -86,15 +103,6 @@ func (s *Service) Mount() {
)
}

// EnableFullAPI will enable all available endpoints, because some endpoints are not available during syncing.
func (s *Service) EnableFullAPI() {
if s == nil {
return
}

s.fullAPIEnabled = true
}

func (s *Service) mountTechnicalDebug() {
s.router.Handle("/node", jsonhttp.MethodHandler{
"GET": http.HandlerFunc(s.nodeGetHandler),
Expand Down

0 comments on commit 46bc6a0

Please sign in to comment.