Unverified 提交 ee12ddeb 作者: Steven Allen 提交者: GitHub

Merge pull request #6215 from MasashiSalvador57f/hotfix/root_redirection

fix the wrong path configuration in root redirection
......@@ -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
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论