Skip to content

Commit 5962ca0

Browse files
SgtPookilidel
andauthored
fix: dag-index html cache-control matches dir-index html (#241)
* fix: dag-index html cache-control matches dir-index html * chore: release as 0.8.1 --------- Co-authored-by: Marcin Rataj <[email protected]>
1 parent bb4780c commit 5962ca0

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [0.8.1] - 2025-06-17
8+
### Changed
9+
- DAG-CBOR HTML preview pages previously had to be returned without Cache-Control headers. Now they can use Cache-Control headers similar to those used in generated UnixFS directory listings. [#241](https://github.com/ipfs/gateway-conformance/pull/241)
10+
711
## [0.8.0] - 2025-05-28
812
### Changed
913
- Comprehensive tests for HTTP Range Requests over deserialized UnixFS files have been added. The `--specs path-gateway` now requires support for at least single-range requests. Deserialized range-requests can be skipped with `--skip 'TestGatewayUnixFSFileRanges'` [#213](https://github.com/ipfs/gateway-conformance/pull/213)

tests/path_gateway_dag_test.go

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -600,14 +600,21 @@ func TestNativeDag(t *testing.T) {
600600
Request: Request().
601601
Path("/ipfs/{{cid}}/", dagTraversalCID).
602602
Header("Accept", "text/html"),
603-
Response: Expect().
604-
Headers(
605-
Header("Etag").Contains("DagIndex-"),
606-
Header("Content-Type").Contains("text/html"),
607-
Header("Content-Disposition").IsEmpty(),
608-
Header("Cache-Control").IsEmpty(),
609-
).Body(
610-
Contains("</html>"),
603+
Response: AllOf(
604+
Expect().
605+
Status(200).
606+
Headers(
607+
Header("Etag").Contains("DagIndex-"),
608+
Header("Content-Type").Contains("text/html"),
609+
Header("Content-Disposition").IsEmpty(),
610+
).
611+
Body(
612+
Contains("</html>"),
613+
),
614+
AnyOf(
615+
Expect().Headers(Header("Cache-Control").IsEmpty()),
616+
Expect().Headers(Header("Cache-Control").Equals("public, max-age=604800, stale-while-revalidate=2678400")),
617+
),
611618
),
612619
},
613620
}

0 commit comments

Comments
 (0)