mirror of
https://github.com/ipfs/kubo.git
synced 2026-02-26 12:57:44 +08:00
Merge pull request #6215 from MasashiSalvador57f/hotfix/root_redirection
fix the wrong path configuration in root redirection
This commit is contained in:
commit
ee12ddebfd
@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user