File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ package tests
2+
3+ import (
4+ "testing"
5+
6+ "github.com/ipfs/gateway-conformance/tooling/specs"
7+ . "github.com/ipfs/gateway-conformance/tooling/test"
8+ )
9+
10+ func TestRedirectCanonicalIPNS (t * testing.T ) {
11+ tests := SugarTests {
12+ {
13+ Name : "GET for /ipns/{b58-multihash-of-ed25519-key} redirects to /ipns/{cidv1-libp2p-key-base36}" ,
14+ Request : Request ().
15+ Path ("/ipns/12D3KooWRBy97UB99e3J6hiPesre1MZeuNQvfan4gBziswrRJsNK/root2/" ),
16+ Response : Expect ().
17+ Status (302 ).
18+ Headers (
19+ Header ("Location" ).Equals ("/ipns/k51qzi5uqu5dlvj2baxnqndepeb86cbk3ng7n3i46uzyxzyqj2xjonzllnv0v8/root2/" ),
20+ ),
21+ },
22+ {
23+ Name : "GET for /ipns/{cidv0-like-b58-multihash-of-rsa-key} redirects to /ipns/{cidv1-libp2p-key-base36}" ,
24+ Request : Request ().
25+ Path ("/ipns/QmcJM7PRfkSbcM5cf1QugM5R37TLRKyJGgBEhXjLTB8uA2/root2/" ),
26+ Response : Expect ().
27+ Status (302 ).
28+ Headers (
29+ Header ("Location" ).Equals ("/ipns/k2k4r8ol4m8kkcqz509c1rcjwunebj02gcnm5excpx842u736nja8ger/root2/" ),
30+ ),
31+ },
32+ }
33+
34+ RunWithSpecs (t , tests , specs .PathGatewayIPNS )
35+ }
You can’t perform that action at this time.
0 commit comments