diff options
author | Runxi Yu <me@runxiyu.org> | 2025-03-22 11:44:59 +0800 |
---|---|---|
committer | Runxi Yu <me@runxiyu.org> | 2025-03-22 11:44:59 +0800 |
commit | c7440c2c3366e516ef9b0f4c34093e0c7f5c23d4 (patch) | |
tree | 4695fba3ffb65a2abbadda90bac2c7511ffcaaf7 /url.go | |
parent | Fix HTTPS cloning (diff) | |
download | forge-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.go | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -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 +} |