mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-22 20:52:27 +00:00
Fix redirect-loop for Hugo server
An extra slash was added to the path if baseUrl had a sub-directory, causing infinite redirect loop in Go's HTTP server. Fixes #510
This commit is contained in:
parent
5e28606b84
commit
8cb435f1f4
1 changed files with 1 additions and 1 deletions
|
@ -121,7 +121,7 @@ func serve(port int) {
|
|||
if u.Path == "" || u.Path == "/" {
|
||||
http.Handle("/", fileserver)
|
||||
} else {
|
||||
http.Handle(u.Path+"/", http.StripPrefix(u.Path+"/", fileserver))
|
||||
http.Handle(u.Path, http.StripPrefix(u.Path, fileserver))
|
||||
}
|
||||
|
||||
u.Scheme = "http"
|
||||
|
|
Loading…
Reference in a new issue