feat: support arbitrary URL proxy via single token
Build and Push to GHCR / build-and-push (push) Has been cancelled

Allow proxying to any URL through the single-token auth path:
- /TOKEN/https://target.com/path
- /TOKEN/https:/target.com/path (browser-normalized)
- /TOKEN/target.com/path (auto-prefixed with https:// for known domains)

Also fix single-mode path handling that previously dropped
parts[2] when SplitN produced 3 parts.

via [HAPI](https://hapi.run)

Co-Authored-By: HAPI <[email protected]>
This commit is contained in:
Agent
2026-05-24 16:22:02 +08:00
co-authored by HAPI
parent e8f760e510
commit fdbb824b7e
3 changed files with 126 additions and 1 deletions
+1 -1
View File
@@ -152,7 +152,7 @@ func ProxyAuthMiddleware(rl *RateLimiter) func(http.Handler) http.Handler {
if len(parts) == 1 {
newPath = "/"
} else {
newPath = "/" + parts[1]
newPath = "/" + strings.Join(parts[1:], "/")
}
}
}