Skip to content

Commit

Permalink
t0114: clear (c)
Browse files Browse the repository at this point in the history
  • Loading branch information
laurentsenta committed Jun 27, 2023
1 parent f2ad8aa commit 3c213fa
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions tests/subdomain_gateway_ipfs_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -348,14 +348,16 @@ func TestGatewaySubdomains(t *testing.T) {
// ## Test support for X-Forwarded-Host
// ## ============================================================================
{
Name: "request for http://fake.domain.com/ipfs/{CID} doesn't match the example.com gateway",
Request: Request().URL("{{scheme}}://{{domain}}/ipfs/{{cid}}", u.Scheme, "fake.domain.com", CIDv1),
Name: "request for http://fake.domain.com/ipfs/{CID} doesn't match the example.com gateway",
Request: Request().
URL("{{scheme}}://{{domain}}/ipfs/{{cid}}", u.Scheme, "fake.domain.com", CIDv1),
Response: Expect().
Status(200),
},
{
Name: "request for http://fake.domain.com/ipfs/{CID} with X-Forwarded-Host: example.com match the example.com gateway",
Request: Request().URL("{{scheme}}://{{domain}}/ipfs/{{cid}}", u.Scheme, "fake.domain.com", CIDv1).
Request: Request().
URL("{{scheme}}://{{domain}}/ipfs/{{cid}}", u.Scheme, "fake.domain.com", CIDv1).
Header("X-Forwarded-Host", u.Host),
Response: Expect().
Status(301).
Expand All @@ -365,7 +367,8 @@ func TestGatewaySubdomains(t *testing.T) {
},
{
Name: "request for http://fake.domain.com/ipfs/{CID} with X-Forwarded-Host: example.com and X-Forwarded-Proto: https match the example.com gateway, redirect with https",
Request: Request().URL("{{scheme}}://{{domain}}/ipfs/{{cid}}", u.Scheme, "fake.domain.com", CIDv1).
Request: Request().
URL("{{scheme}}://{{domain}}/ipfs/{{cid}}", u.Scheme, "fake.domain.com", CIDv1).
Header("X-Forwarded-Host", u.Host).
Header("X-Forwarded-Proto", "https"),
Response: Expect().
Expand Down

0 comments on commit 3c213fa

Please sign in to comment.