You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 25, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: packages/headers/CHANGELOG.md
+19Lines changed: 19 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,25 @@ let cookieNames = Array.from(headers.cookie.names());
18
18
let cookieNames =headers.cookie.names;
19
19
```
20
20
21
+
Additionally, this release adds support for the `If-None-Match` header. This is useful for conditional GET requests where you want to return a response with content only if the ETag has changed.
22
+
23
+
```ts
24
+
import { SuperHeaders } from'@mjackson/headers';
25
+
26
+
function requestHandler(request:Request):Promise<Response> {
27
+
let response =awaitcallDownstreamService(request);
28
+
29
+
if (request.method==='GET'&&response.headers.has('ETag')) {
30
+
let headers =newSuperHeaders(request.headers);
31
+
if (headers.ifNoneMatch.matches(response.headers.get('ETag'))) {
32
+
returnnewResponse(null, { status: 304 });
33
+
}
34
+
}
35
+
36
+
returnresponse;
37
+
}
38
+
```
39
+
21
40
## v0.9.0 (2024-12-20)
22
41
23
42
This release tightens up the type safety and brings `SuperHeaders` more in line with the built-in `Headers` interface.
0 commit comments