Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs/kubo
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dacdeb1081a3
Choose a base ref
...
head repository: ipfs/kubo
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 4e71ce3cc7ea
Choose a head ref
  • 3 commits
  • 1 file changed
  • 2 contributors

Commits on May 21, 2015

  1. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    373260d View commit details
  2. Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    8df8737 View commit details

Commits on May 24, 2015

  1. Merge pull request #1272 from Luzifer/fix/dnslink

    Fix: dnslink domain resolving was broken; Add: no caching for those
    jbenet committed May 24, 2015
    Copy the full SHA
    4e71ce3 View commit details
Showing with 6 additions and 3 deletions.
  1. +6 −3 core/corehttp/ipns_hostname.go
9 changes: 6 additions & 3 deletions core/corehttp/ipns_hostname.go
Original file line number Diff line number Diff line change
@@ -2,9 +2,9 @@ package corehttp

import (
"net/http"
"path"
"strings"

isd "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-is-domain"
"github.com/ipfs/go-ipfs/Godeps/_workspace/src/golang.org/x/net/context"
"github.com/ipfs/go-ipfs/core"
)
@@ -20,8 +20,11 @@ func IPNSHostnameOption() ServeOption {
defer cancel()

host := strings.SplitN(r.Host, ":", 2)[0]
if p, err := n.Namesys.Resolve(ctx, host); err == nil {
r.URL.Path = path.Join(p.String(), r.URL.Path)
if len(host) > 0 && isd.IsDomain(host) {
name := "/ipns/" + host
if _, err := n.Namesys.Resolve(ctx, name); err == nil {
r.URL.Path = name + r.URL.Path
}
}
childMux.ServeHTTP(w, r)
})