From 619c226e8787fdac53ef5490ab2949067509a888 Mon Sep 17 00:00:00 2001 From: Steven Allen Date: Sun, 26 Apr 2020 16:11:20 -0700 Subject: [PATCH] feat: show the absolute path every time Even for dnslink websites. fixes https://github.com/ipfs/go-ipfs/issues/7205 --- core/corehttp/gateway_handler.go | 2 +- core/corehttp/gateway_test.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/corehttp/gateway_handler.go b/core/corehttp/gateway_handler.go index f34bbeb76b93..2729f04e6199 100644 --- a/core/corehttp/gateway_handler.go +++ b/core/corehttp/gateway_handler.go @@ -335,7 +335,7 @@ func (i *gatewayHandler) getOrHeadHandler(w http.ResponseWriter, r *http.Request // See comment above where originalUrlPath is declared. tplData := listingTemplateData{ Listing: dirListing, - Path: originalUrlPath, + Path: urlPath, BackLink: backLink, Hash: hash, } diff --git a/core/corehttp/gateway_test.go b/core/corehttp/gateway_test.go index daf1af07c6c8..6f442b318f39 100644 --- a/core/corehttp/gateway_test.go +++ b/core/corehttp/gateway_test.go @@ -378,7 +378,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) { s := string(body) t.Logf("body: %s\n", string(body)) - if !strings.Contains(s, "Index of /foo? #<'/") { + if !strings.Contains(s, "Index of /ipns/example.net/foo? #<'/") { t.Fatalf("expected a path in directory listing") } if !strings.Contains(s, "") {