feat: handle missing trailing slashes for console and login (#3490)

* handle calls without trailing slash

* build redirect uris correctly

* handle missing trailing slash for login

* sentry as http middleware

* import

* fix build origin
This commit is contained in:
Livio Amstutz
2022-04-26 12:13:16 +02:00
committed by GitHub
parent 388ef6b93b
commit 32986aa60a
5 changed files with 14 additions and 12 deletions

View File

@@ -77,9 +77,9 @@ func (a *API) RegisterServer(ctx context.Context, grpcServer server.Server) erro
func (a *API) RegisterHandler(prefix string, handler http.Handler) {
prefix = strings.TrimSuffix(prefix, "/")
sentryHandler := sentryhttp.New(sentryhttp.Options{})
subRouter := a.router.PathPrefix(prefix).Subrouter()
subRouter.PathPrefix("/").Handler(http.StripPrefix(prefix, sentryHandler.Handle(handler)))
subRouter := a.router.PathPrefix(prefix).Name(prefix).Subrouter()
subRouter.Use(sentryhttp.New(sentryhttp.Options{}).Handle)
subRouter.PathPrefix("").Handler(http.StripPrefix(prefix, handler))
}
func (a *API) routeGRPC() {