aboutsummaryrefslogtreecommitdiff
path: root/url.go
diff options
context:
space:
mode:
authorRunxi Yu <me@runxiyu.org>2025-03-06 15:17:57 +0800
committerRunxi Yu <me@runxiyu.org>2025-03-06 20:07:48 +0800
commit8ed0dbe4201a58b00d6f3743178f4cbe5328e2b0 (patch)
treea2f33fccac42b554b1176741d00c1d0cd2d0dceb /url.go
parentsql: Add purge and test scripts (diff)
downloadforge-8ed0dbe4201a58b00d6f3743178f4cbe5328e2b0.tar.gz
forge-8ed0dbe4201a58b00d6f3743178f4cbe5328e2b0.tar.zst
forge-8ed0dbe4201a58b00d6f3743178f4cbe5328e2b0.zip
*: Support subgroups via SQL recursion
Diffstat (limited to 'url.go')
-rw-r--r--url.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/url.go b/url.go
index d391de2..8be7047 100644
--- a/url.go
+++ b/url.go
@@ -98,3 +98,10 @@ func redirect_without_slash(w http.ResponseWriter, r *http.Request) bool {
}
return false
}
+
+func path_escape_cat_segments(segments []string) string {
+ for i, segment := range segments {
+ segments[i] = url.PathEscape(segment)
+ }
+ return strings.Join(segments, "/")
+}