Skip to content

docs: fix Headers.append() call to use two arguments - #15149

Merged
brophdawg11 merged 2 commits into
remix-run:mainfrom
DucMinhNe:fix/docs-headers-append-two-args
Jun 5, 2026
Merged

docs: fix Headers.append() call to use two arguments#15149
brophdawg11 merged 2 commits into
remix-run:mainfrom
DucMinhNe:fix/docs-headers-append-two-args

Conversation

@DucMinhNe

Copy link
Copy Markdown
Contributor

Problem

The "Merging with parent headers → Appending" example in docs/how-to/headers.md calls Headers.append() with a single combined string:

parentHeaders.append(
  "Permissions-Policy: geolocation=()",
);

But the Web Fetch Headers.append(name, value) API takes two arguments. Copy-pasting this throws at runtime:

TypeError: Headers.append: 2 arguments required, but only 1 found.

(reproduced on Node v22). The .set("Cache-Control", "...") example just below it in the same section already uses the correct two-argument form.

Fix

Split into the two-argument call — docs-only, one example:

parentHeaders.append(
  "Permissions-Policy",
  "geolocation=()",
);

@remix-cla-bot

remix-cla-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Hi @DucMinhNe,

Welcome, and thank you for contributing to React Router!

Before we consider your pull request, we ask that you sign our Contributor License Agreement (CLA). We require this only once.

You may review the CLA and sign it by adding your name to contributors.yml.

Once the CLA is signed, the CLA Signed label will be added to the pull request.

If you have already signed the CLA and received this response in error, or if you have any questions, please contact us at hello@remix.run.

Thanks!

- The Remix team

@remix-cla-bot

remix-cla-bot Bot commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Thank you for signing the Contributor License Agreement. Let's get this merged! 🥳

@brophdawg11 brophdawg11 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@brophdawg11
brophdawg11 merged commit 00aa485 into remix-run:main Jun 5, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants