router/request: add some clarifying comments

This commit is contained in:
Trong Huu Nguyen
2022-07-04 13:21:33 +02:00
parent 1f830b5dc8
commit 303708ea65

View File

@@ -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()