handle path encoding for repository names containing special characters

This commit is contained in:
mappu 2020-05-05 19:30:19 +12:00
parent 902e1be59c
commit 7045794c8e

View File

@ -301,7 +301,14 @@ func (this *Application) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return
}
this.Repopage(w, r, parts[1])
// Proper decoding of special characters in repo path component
repoName, err := url.PathUnescape(parts[1])
if err != nil {
http.Error(w, "malformed url encoding in repository name", 400)
return
}
this.Repopage(w, r, repoName)
} else if r.URL.Path == `/static/logo.png` {
if this.cfg.Template.CustomLogoPngBase64 != "" {