Redirect to collection url if improperly formatted

This commit is contained in:
Abhishek Shroff
2024-03-17 21:03:01 +05:30
parent caa21cb448
commit 25328509de

View File

@@ -24,6 +24,10 @@ var htmlReplacer = strings.NewReplacer(
)
func serveCollection(w http.ResponseWriter, r *http.Request, ri ResourceInfo) {
if !strings.HasSuffix(r.URL.Path, "/") {
http.Redirect(w, r, r.URL.String()+"/", http.StatusMovedPermanently)
return
}
if checkIfModifiedSince(r, ri) == condFalse {
writeNotModified(w)
return