@cryptotaxi247 / kubo / commits / 1b3797474

Fix: Using the `dnslink` feature led to infinite redirects

fixes #1233

Knut Ahlers committed May 16, 2015 at 15:12 UTC 1b3797474f4f5a8a9be533da8c7eca2372d2befe
1 file changed +2 -1
core/corehttp/ipns_hostname.go
+2 -1
@@ -2,6 +2,7 @@ package corehttp
2
3 import (
4 "net/http"
5 + "path"
6 "strings"
7
8 "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
@@ -20,7 +21,7 @@ func IPNSHostnameOption() ServeOption {
21
22 host := strings.SplitN(r.Host, ":", 2)[0]
23 if p, err := n.Namesys.Resolve(ctx, host); err == nil {
23 - r.URL.Path = p.String() + r.URL.Path
24 + r.URL.Path = path.Join(p.String(), r.URL.Path)
25 }
26 childMux.ServeHTTP(w, r)
27 })