aboutsummaryrefslogtreecommitdiff
path: root/url.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-22 11:44:59 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-22 11:44:59 +0800
commitc7440c2c3366e516ef9b0f4c34093e0c7f5c23d4 (patch)
tree4695fba3ffb65a2abbadda90bac2c7511ffcaaf7 /url.go
parentFix HTTPS cloning (diff)
downloadforge-c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4.tar.gz
forge-c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4.tar.zst
forge-c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4.zip
Fix tree/raw redirection and disallow slashes in their path segments
Diffstat (limited to 'url.go')
-rw-r--r--url.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/url.go b/url.go
index 3978c6e..57cb196 100644
--- a/url.go
+++ b/url.go
@@ -119,3 +119,12 @@ func segmentsToURL(segments []string) string {
}
return strings.Join(segments, "/")
}
+
+func anyContain(ss []string, c string) bool {
+ for _, s := range ss {
+ if strings.Contains(s, c) {
+ return true
+ }
+ }
+ return false
+}