From 303708ea657745c51ec6316959c4ce7aa1188b2a Mon Sep 17 00:00:00 2001 From: Trong Huu Nguyen Date: Mon, 4 Jul 2022 13:21:33 +0200 Subject: [PATCH] router/request: add some clarifying comments --- pkg/router/request/request.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/router/request/request.go b/pkg/router/request/request.go index 26735c5..aa6f5f4 100644 --- a/pkg/router/request/request.go +++ b/pkg/router/request/request.go @@ -70,6 +70,7 @@ func parseRedirectParam(r *http.Request) (string, bool) { redirectParamURLString := redirectParamURL.String() + // root path without trailing slash is empty if len(redirectParamURLString) == 0 { redirectParamURLString = "/" } @@ -103,6 +104,7 @@ func refererPath(r *http.Request) string { return "" } + // strip scheme and host to avoid cross-domain redirects referer.Scheme = "" referer.Host = "" return referer.String()