@@ -138,7 +138,7 @@ func newTestServerAndNode(t *testing.T, ns mockNamesys) (*httptest.Server, iface
138
138
139
139
dh .Handler , err = makeHandler (n ,
140
140
ts .Listener ,
141
- IPNSHostnameOption (),
141
+ HostnameOption (),
142
142
GatewayOption (false , "/ipfs" , "/ipns" ),
143
143
VersionOption (),
144
144
)
@@ -184,12 +184,12 @@ func TestGatewayGet(t *testing.T) {
184
184
status int
185
185
text string
186
186
}{
187
- {"localhost:5001 " , "/" , http .StatusNotFound , "404 page not found\n " },
188
- {"localhost:5001 " , "/" + k .Cid ().String (), http .StatusNotFound , "404 page not found\n " },
189
- {"localhost:5001 " , k .String (), http .StatusOK , "fnord" },
190
- {"localhost:5001 " , "/ipns/nxdomain.example.com" , http .StatusNotFound , "ipfs resolve -r /ipns/nxdomain.example.com: " + namesys .ErrResolveFailed .Error () + "\n " },
191
- {"localhost:5001 " , "/ipns/%0D%0A%0D%0Ahello" , http .StatusNotFound , "ipfs resolve -r /ipns/%0D%0A%0D%0Ahello: " + namesys .ErrResolveFailed .Error () + "\n " },
192
- {"localhost:5001 " , "/ipns/example.com" , http .StatusOK , "fnord" },
187
+ {"127.0.0.1:8080 " , "/" , http .StatusNotFound , "404 page not found\n " },
188
+ {"127.0.0.1:8080 " , "/" + k .Cid ().String (), http .StatusNotFound , "404 page not found\n " },
189
+ {"127.0.0.1:8080 " , k .String (), http .StatusOK , "fnord" },
190
+ {"127.0.0.1:8080 " , "/ipns/nxdomain.example.com" , http .StatusNotFound , "ipfs resolve -r /ipns/nxdomain.example.com: " + namesys .ErrResolveFailed .Error () + "\n " },
191
+ {"127.0.0.1:8080 " , "/ipns/%0D%0A%0D%0Ahello" , http .StatusNotFound , "ipfs resolve -r /ipns/%0D%0A%0D%0Ahello: " + namesys .ErrResolveFailed .Error () + "\n " },
192
+ {"127.0.0.1:8080 " , "/ipns/example.com" , http .StatusOK , "fnord" },
193
193
{"example.com" , "/" , http .StatusOK , "fnord" },
194
194
195
195
{"working.example.com" , "/" , http .StatusOK , "fnord" },
@@ -381,7 +381,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
381
381
if ! strings .Contains (s , "Index of /foo? #<'/" ) {
382
382
t .Fatalf ("expected a path in directory listing" )
383
383
}
384
- if ! strings .Contains (s , "<a href=\" /\" >" ) {
384
+ if ! strings .Contains (s , "<a href=\" /foo%3F%20%23%3C%27/./.. \" >" ) {
385
385
t .Fatalf ("expected backlink in directory listing" )
386
386
}
387
387
if ! strings .Contains (s , "<a href=\" /foo%3F%20%23%3C%27/file.txt\" >" ) {
@@ -447,7 +447,7 @@ func TestIPNSHostnameBacklinks(t *testing.T) {
447
447
if ! strings .Contains (s , "Index of /foo? #<'/bar/" ) {
448
448
t .Fatalf ("expected a path in directory listing" )
449
449
}
450
- if ! strings .Contains (s , "<a href=\" /foo%3F%20%23%3C%27/\" >" ) {
450
+ if ! strings .Contains (s , "<a href=\" /foo%3F%20%23%3C%27/bar/./.. \" >" ) {
451
451
t .Fatalf ("expected backlink in directory listing" )
452
452
}
453
453
if ! strings .Contains (s , "<a href=\" /foo%3F%20%23%3C%27/bar/file.txt\" >" ) {
0 commit comments