Skip to content

Commit

Permalink
Merge pull request #6215 from MasashiSalvador57f/hotfix/root_redirection
Browse files Browse the repository at this point in the history
fix the wrong path configuration in root redirection
  • Loading branch information
Stebalien authored Apr 16, 2019
2 parents 8efc825 + 04c8726 commit ee12dde
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/corehttp/redirect.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ import (
func RedirectOption(path string, redirect string) ServeOption {
handler := &redirectHandler{redirect}
return func(n *core.IpfsNode, _ net.Listener, mux *http.ServeMux) (*http.ServeMux, error) {
mux.Handle("/"+path+"/", handler)
if len(path) > 0 {
mux.Handle("/"+path+"/", handler)
} else {
mux.Handle("/", handler)
}
return mux, nil
}
}
Expand Down

0 comments on commit ee12dde

Please sign in to comment.