use go-chi middlewares
go-chi already delivers the middlewares we need so we don't need to import other libraries for that.
This commit is contained in:
@@ -3,6 +3,7 @@ package http
|
||||
import (
|
||||
"github.com/asim/go-micro/v3"
|
||||
"github.com/go-chi/chi"
|
||||
chimiddleware "github.com/go-chi/chi/middleware"
|
||||
"github.com/owncloud/ocis/accounts/pkg/assets"
|
||||
"github.com/owncloud/ocis/accounts/pkg/proto/v0"
|
||||
"github.com/owncloud/ocis/accounts/pkg/version"
|
||||
@@ -28,8 +29,8 @@ func Server(opts ...Option) http.Service {
|
||||
|
||||
mux := chi.NewMux()
|
||||
|
||||
mux.Use(middleware.RealIP)
|
||||
mux.Use(middleware.RequestID)
|
||||
mux.Use(chimiddleware.RealIP)
|
||||
mux.Use(chimiddleware.RequestID)
|
||||
mux.Use(middleware.NoCache)
|
||||
mux.Use(middleware.Cors)
|
||||
mux.Use(middleware.Secure)
|
||||
|
||||
Reference in New Issue
Block a user