Compare repository URLs with casefolding.

Codeberg repository URLs are equal modulo case, and without this
normalization step some repositories can't be published.
This commit is contained in:
Catherine
2025-09-15 14:56:09 +00:00
parent 9d02387f5d
commit 87be9973b4
+1 -1
View File
@@ -210,7 +210,7 @@ func postPage(w http.ResponseWriter, r *http.Request) error {
webRoot := fmt.Sprintf("%s/%s", host, projectName)
repoURL := event["repository"].(map[string]any)["clone_url"].(string)
if allowRepoURL != "" && repoURL != allowRepoURL {
if allowRepoURL != "" && !strings.EqualFold(repoURL, allowRepoURL) {
http.Error(w,
fmt.Sprintf("wildcard domain requires repository to be %s", allowRepoURL),
http.StatusUnauthorized,