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:
David Christofas
2021-08-12 17:14:41 +02:00
parent 2927dc45c3
commit 3bc60510ce
16 changed files with 37 additions and 66 deletions
+3 -2
View File
@@ -2,6 +2,7 @@ package http
import (
"github.com/asim/go-micro/v3"
chimiddleware "github.com/go-chi/chi/middleware"
svc "github.com/owncloud/ocis/graph-explorer/pkg/service/v0"
"github.com/owncloud/ocis/graph-explorer/pkg/version"
"github.com/owncloud/ocis/ocis-pkg/middleware"
@@ -26,8 +27,8 @@ func Server(opts ...Option) (http.Service, error) {
svc.Logger(options.Logger),
svc.Config(options.Config),
svc.Middleware(
middleware.RealIP,
middleware.RequestID,
chimiddleware.RealIP,
chimiddleware.RequestID,
middleware.NoCache,
middleware.Cors,
middleware.Secure,