1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-06-30 09:59:13 +08:00

Fix: Using the dnslink feature led to infinite redirects

fixes #1233
This commit is contained in:
Knut Ahlers
2015-05-16 15:12:24 +02:00
parent 01e1e71221
commit 1b3797474f

View File

@ -2,6 +2,7 @@ package corehttp
import (
"net/http"
"path"
"strings"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
@ -20,7 +21,7 @@ func IPNSHostnameOption() ServeOption {
host := strings.SplitN(r.Host, ":", 2)[0]
if p, err := n.Namesys.Resolve(ctx, host); err == nil {
r.URL.Path = p.String() + r.URL.Path
r.URL.Path = path.Join(p.String(), r.URL.Path)
}
childMux.ServeHTTP(w, r)
})