-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dnslink resolution broken in 0.3.4 #1267
Comments
# curl -i -H 'Host: swagger.luzifer.io' http://localhost:8080/ipfs/QmczrnBpAgnhCo87rtZ8VbLfGU5v8g7cKr7Ef2fKRvYniA/
HTTP/1.1 200 OK
Cache-Control: public, max-age=29030400
Etag: QmczrnBpAgnhCo87rtZ8VbLfGU5v8g7cKr7Ef2fKRvYniA
Suborigin: QmczrnBpAgnhCo87rtZ8VbLfGU5v8g7cKr7Ef2fKRvYniA
X-Ipfs-Path: /ipfs/QmczrnBpAgnhCo87rtZ8VbLfGU5v8g7cKr7Ef2fKRvYniA/
Date: Thu, 21 May 2015 05:28:00 GMT
Content-Type: text/html; charset=utf-8
Transfer-Encoding: chunked
<!DOCTYPE html> Hostnames with |
# ./ipfs daemon 2>&1
Initializing daemon...
API server listening on /ip4/127.0.0.1/tcp/5001
Ohai IPNSHostnameOption
Gateway (readonly) server listening on /ip4/127.0.0.1/tcp/8080
Ohai HandleFunc
ERR: not a key
^C
Received interrupt signal, shutting down...
Publishing!
07:58:00.873 ERROR ipnsfs: leveldb: closed system.go:83 diff --git a/core/corehttp/ipns_hostname.go b/core/corehttp/ipns_hostname.go
index f651cc6..97867fc 100644
--- a/core/corehttp/ipns_hostname.go
+++ b/core/corehttp/ipns_hostname.go
@@ -1,6 +1,7 @@
package corehttp
import (
+ "fmt"
"net/http"
"path"
"strings"
@@ -13,15 +14,20 @@ import (
// an IPNS name.
// The rewritten request points at the resolved name on the gateway handler.
func IPNSHostnameOption() ServeOption {
+ fmt.Printf("Ohai IPNSHostnameOption\n")
return func(n *core.IpfsNode, mux *http.ServeMux) (*http.ServeMux, error) {
childMux := http.NewServeMux()
mux.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
+ fmt.Printf("Ohai HandleFunc\n")
ctx, cancel := context.WithCancel(n.Context())
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)
+ fmt.Printf("%s\n", r.URL.Path)
+ } else {
+ fmt.Printf("ERR: %s", err)
}
childMux.ServeHTTP(w, r)
}) # ag "not a key"
path/path.go
82: return "", errors.New("not a key") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
In
0.3.4
dnslink
resolution for domains is completely broken.namesys
is not resolving the hostsdnslink
according toipfs daemon --debug
so the path seems to be intercepted beforeipns_hostname.go
The text was updated successfully, but these errors were encountered: