handle path encoding for repository names containing special characters
This commit is contained in:
parent
902e1be59c
commit
7045794c8e
9
main.go
9
main.go
@ -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 != "" {
|
||||
|
Loading…
Reference in New Issue
Block a user