We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
/auth=TOKEN
1 parent bc68083 commit 5389b3aCopy full SHA for 5389b3a
1 file changed
internals/proxy/middlewares/auth.go
@@ -183,11 +183,13 @@ var PathAuth = AuthMethod{
183
Authenticate: func(w http.ResponseWriter, req *http.Request, tokens []string) (string, error) {
184
parts := strings.Split(req.URL.Path, "/")
185
186
- if len(parts) == 0 {
+ if len(parts) <= 1 {
187
return "", nil
188
}
189
190
- unescaped, err := url.PathUnescape(parts[1])
+ parts = parts[1:]
191
+
192
+ unescaped, err := url.PathUnescape(parts[0])
193
194
if err != nil {
195
@@ -199,6 +201,8 @@ var PathAuth = AuthMethod{
199
201
200
202
203
204
+ req.URL.Path = "/" + strings.Join(parts[1:], "/")
205
206
if isValidToken(tokens, auth) {
207
return auth, nil
208
0 commit comments