Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-pages.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessio Caiazza <acaiazza@gitlab.com>2018-10-11 12:01:53 +0300
committerAlessio Caiazza <acaiazza@gitlab.com>2018-10-12 10:45:05 +0300
commite61224b2348b733ab7038e56f42771652d8fc3f3 (patch)
tree86280985e01958186f3de9dc1a868899e1253982
parentcc29737d96d41a7ce5e54f67bebe39ae507bb99e (diff)
Fix 404 for project with capital letters
When loading domains map from disk we lowercase the project name, this patch will lowercase it also when checking incoming HTTP requests against the configuration map.
-rw-r--r--internal/domain/domain.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/internal/domain/domain.go b/internal/domain/domain.go
index c9bda506..261707cf 100644
--- a/internal/domain/domain.go
+++ b/internal/domain/domain.go
@@ -118,7 +118,8 @@ func (d *D) getProjectWithSubpath(r *http.Request) (*project, string, string) {
// If present, these projects shadow the group domain.
split := strings.SplitN(r.URL.Path, "/", 3)
if len(split) >= 2 {
- if project := d.projects[split[1]]; project != nil {
+ projectName := strings.ToLower(split[1])
+ if project := d.projects[projectName]; project != nil {
return project, split[1], strings.Join(split[2:], "/")
}
}