Skip to content

Commit

Permalink
feat(services): use RealIP middleware in handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
Icikowski committed Nov 17, 2022
1 parent 2443e9e commit 4c12535
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/services/admin/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ const (

func (s *AdminAPIService) buildHandler() {
handler := chi.NewRouter()
handler.Use(middleware.RealIP)
handler.Use(middleware.CleanPath)
handler.Use(s.contentLogger)
handler.Use(s.adminApiHeader)
Expand Down
1 change: 1 addition & 0 deletions src/services/content/service.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ func (s *ContentService) buildHandler(routes model.Routes) {
s.log.Debug().Msg("building handler")

handler := chi.NewRouter()
handler.Use(middleware.RealIP)
handler.Use(middleware.CleanPath)
handler.Use(s.contentLogger)
handler.Use(middleware.Recoverer)
Expand Down

0 comments on commit 4c12535

Please sign in to comment.