Commit 9b4b2c68 authored by Juan Batiz-Benet's avatar Juan Batiz-Benet

Merge pull request #1235 from Luzifer/fix/dnslink-issues

Fix: Using the `dnslink` feature led to infinite redirects
parents d51f28e8 1b379747
...@@ -2,6 +2,7 @@ package corehttp ...@@ -2,6 +2,7 @@ package corehttp
import ( import (
"net/http" "net/http"
"path"
"strings" "strings"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context" "github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
...@@ -20,7 +21,7 @@ func IPNSHostnameOption() ServeOption { ...@@ -20,7 +21,7 @@ func IPNSHostnameOption() ServeOption {
host := strings.SplitN(r.Host, ":", 2)[0] host := strings.SplitN(r.Host, ":", 2)[0]
if p, err := n.Namesys.Resolve(ctx, host); err == nil { 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) childMux.ServeHTTP(w, r)
}) })
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment