diff options
author | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-11 12:01:53 +0300 |
---|---|---|
committer | Alessio Caiazza <acaiazza@gitlab.com> | 2018-10-12 10:45:05 +0300 |
commit | e61224b2348b733ab7038e56f42771652d8fc3f3 (patch) | |
tree | 86280985e01958186f3de9dc1a868899e1253982 /internal/domain/domain.go | |
parent | cc29737d96d41a7ce5e54f67bebe39ae507bb99e (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.
Diffstat (limited to 'internal/domain/domain.go')
-rw-r--r-- | internal/domain/domain.go | 3 |
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:], "/") } } |