mirror of
https://github.com/ipfs/kubo.git
synced 2026-03-01 06:17:56 +08:00
feat: show the absolute path every time
Even for dnslink websites. fixes https://github.com/ipfs/go-ipfs/issues/7205
This commit is contained in:
parent
d8bc5c991e
commit
46ae021733
@ -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,
|
||||
}
|
||||
|
||||
@ -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, "<a href=\"/foo%3F%20%23%3C%27/./..\">") {
|
||||
@ -444,7 +444,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
|
||||
s = string(body)
|
||||
t.Logf("body: %s\n", string(body))
|
||||
|
||||
if !strings.Contains(s, "Index of /foo? #<'/bar/") {
|
||||
if !strings.Contains(s, "Index of /ipns/example.net/foo? #<'/bar/") {
|
||||
t.Fatalf("expected a path in directory listing")
|
||||
}
|
||||
if !strings.Contains(s, "<a href=\"/foo%3F%20%23%3C%27/bar/./..\">") {
|
||||
@ -478,7 +478,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
|
||||
s = string(body)
|
||||
t.Logf("body: %s\n", string(body))
|
||||
|
||||
if !strings.Contains(s, "Index of /good-prefix") {
|
||||
if !strings.Contains(s, "Index of /ipns/example.net") {
|
||||
t.Fatalf("expected a path in directory listing")
|
||||
}
|
||||
if !strings.Contains(s, "<a href=\"/good-prefix/\">") {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user