Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expect all URL escapes to use uppercase hex #232

Merged
merged 2 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.7.1] - 2025-01-03
### Changed
- Expect all URL escapes to use uppercase hex [#232](https://github.com/ipfs/gateway-conformance/pull/232)

## [0.7.0] - 2025-01-03
### Changed
- Update dependencies [#226](https://github.com/ipfs/gateway-conformance/pull/226) and [#227](https://github.com/ipfs/gateway-conformance/pull/227)
Expand Down
4 changes: 2 additions & 2 deletions docs/test-dsl-syntax.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ for non-GO developers that want to read or contribute tests.

golang's default string formating package is similar to C. Format strings might look like `"this is a %s"` where `%s` is a verb that will be replaced at runtime.

These verbs collides with URL-escaping a lot, strings like `/ipfs/Qm.../%c4%85/%c4%99` might trigger weird errors. We implemented a minimal templating library that is used almost everywhere in the test.
These verbs collides with URL-escaping a lot, strings like `/ipfs/Qm.../%C4%85/%C4%99` might trigger weird errors. We implemented a minimal templating library that is used almost everywhere in the test.

It uses `{{name}}` as a replacement for `%s`. Other verbs are not supported.

Expand All @@ -28,7 +28,7 @@ Fmt(`Etag: W/"{{etag-value}}"`, "weak-key") // => "ETag: W/\"weak-key\""
It is required to always provide a meaningful `{{name}}`:

```golang
Fmt(`/ipfs/{{cid}}/%c4%85/%c4%99`, fixture.myCID) // => "/ipfs/Qm..../%c4%85/%c4%99"
Fmt(`/ipfs/{{cid}}/%C4%85/%C4%99`, fixture.myCID) // => "/ipfs/Qm..../%C4%85/%C4%99"
```

Values are replaced in the order they are defined, and you may reuse named values
Expand Down
2 changes: 1 addition & 1 deletion tests/dnslink_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ func TestDNSLinkGatewayUnixFSDirectoryListing(t *testing.T) {
Response: Expect().
Status(301).
Headers(
Header("Location").Equals(`/%c4%85/%c4%99/`),
Header("Location").Equals(`/%C4%85/%C4%99/`),
),
},
{
Expand Down
Loading