Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-dms3
Commits
373260d3
Commit
373260d3
authored
May 21, 2015
by
Knut Ahlers
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: dnslink domain resolving was broken; Add: no caching for those
fixes #1234 fixes #1267
parent
5c94a68a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
core/corehttp/ipns_hostname.go
core/corehttp/ipns_hostname.go
+6
-2
No files found.
core/corehttp/ipns_hostname.go
View file @
373260d3
...
...
@@ -5,6 +5,7 @@ import (
"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 +21,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
=
path
.
Join
(
"/ipns/"
,
host
)
+
r
.
URL
.
Path
}
}
childMux
.
ServeHTTP
(
w
,
r
)
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment