Skip to content

Conversation

@dependabot
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Feb 3, 2025

Bumps @mjackson/headers from 0.9.0 to 0.10.0.

Release notes

Sourced from @​mjackson/headers's releases.

headers v0.10.0

This release contains several improvements to Cookie that bring it more in line with other headers like Accept, AcceptEncoding, and AcceptLanguage.

  • BREAKING CHANGE: cookie.names() and cookie.values() are now getters that return string[] instead of methods that return IterableIterator<string>
  • BREAKING CHANGE: cookie.forEach() calls its callback with (name, value, cookie) instead of (value, name, map)
  • BREAKING CHANGE: cookie.delete(name) returns void instead of boolean
// before
let cookieNames = Array.from(headers.cookie.names());
// after
let cookieNames = headers.cookie.names;

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.

import { SuperHeaders } from '@mjackson/headers';
function requestHandler(request: Request): Promise<Response> {
let response = await callDownstreamService(request);
if (request.method === 'GET' && response.headers.has('ETag')) {
let headers = new SuperHeaders(request.headers);
if (headers.ifNoneMatch.matches(response.headers.get('ETag'))) {
return new Response(null, { status: 304 });
}
}
return response;
}

Changelog

Sourced from @​mjackson/headers's changelog.

v0.10.0 (2025-01-27)

This release contains several improvements to Cookie that bring it more in line with other headers like Accept, AcceptEncoding, and AcceptLanguage.

  • BREAKING CHANGE: cookie.names() and cookie.values() are now getters that return string[] instead of methods that return IterableIterator<string>
  • BREAKING CHANGE: cookie.forEach() calls its callback with (name, value, cookie) instead of (value, name, map)
  • BREAKING CHANGE: cookie.delete(name) returns void instead of boolean
// before
let cookieNames = Array.from(headers.cookie.names());
// after
let cookieNames = headers.cookie.names;

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.

import { SuperHeaders } from '@mjackson/headers';
function requestHandler(request: Request): Promise<Response> {
let response = await callDownstreamService(request);
if (request.method === 'GET' && response.headers.has('ETag')) {
let headers = new SuperHeaders(request.headers);
if (headers.ifNoneMatch.matches(response.headers.get('ETag'))) {
return new Response(null, { status: 304 });
}
}
return response;
}

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

Bumps [@mjackson/headers](https://github.com/mjackson/remix-the-web/tree/HEAD/packages/headers) from 0.9.0 to 0.10.0.
- [Release notes](https://github.com/mjackson/remix-the-web/releases)
- [Changelog](https://github.com/mjackson/remix-the-web/blob/main/packages/headers/CHANGELOG.md)
- [Commits](https://github.com/mjackson/remix-the-web/commits/headers@0.10.0/packages/headers)

---
updated-dependencies:
- dependency-name: "@mjackson/headers"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Feb 3, 2025
@dependabot dependabot bot requested a review from sergiodxa February 3, 2025 05:46
@github-actions github-actions bot merged commit 58601df into main Feb 3, 2025
1 of 6 checks passed
@github-actions github-actions bot deleted the dependabot/npm_and_yarn/mjackson/headers-0.10.0 branch February 3, 2025 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants