From 009e9eb163e2a7662187afe010d73c515ca536b7 Mon Sep 17 00:00:00 2001 From: Maxim Lebedev Date: Tue, 17 Jan 2023 00:19:54 +0600 Subject: [PATCH] :bug: Fixed duplicating path join --- internal/auth/delivery/http/auth_http.go | 4 ++-- main.go | 2 -- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/internal/auth/delivery/http/auth_http.go b/internal/auth/delivery/http/auth_http.go index caa61bb..5144997 100644 --- a/internal/auth/delivery/http/auth_http.go +++ b/internal/auth/delivery/http/auth_http.go @@ -51,7 +51,7 @@ func (h *Handler) Handler() http.Handler { Skipper: func(w http.ResponseWriter, r *http.Request) bool { head, _ := urlutil.ShiftPath(r.URL.Path) - return r.Method == http.MethodPost && head == "authorize" + return r.Method == http.MethodPost && head == "" }, CookieMaxAge: 0, CookieSameSite: http.SameSiteStrictMode, @@ -68,7 +68,7 @@ func (h *Handler) Handler() http.Handler { Skipper: func(w http.ResponseWriter, r *http.Request) bool { head, _ := urlutil.ShiftPath(r.URL.Path) - return r.Method != http.MethodPost || head != "api" + return r.Method != http.MethodPost || head != "verify" }, Validator: func(w http.ResponseWriter, r *http.Request, login, password string) (bool, error) { userMatch := subtle.ConstantTimeCompare([]byte(login), diff --git a/main.go b/main.go index f89f53c..c129967 100644 --- a/main.go +++ b/main.go @@ -351,8 +351,6 @@ func (app *App) Handler() http.Handler { switch head { case "", "callback", "token", "introspect", "revocation": - r.URL = r.URL.JoinPath(head, r.URL.Path) - default: if r.URL.Path != "/" { r.URL = r.URL.JoinPath(head, r.URL.Path) } else {