Skip to content

always set accept/accept-language headers when making a self-request - #7722

Merged
Rich-Harris merged 1 commit into
masterfrom
gh-7720
Nov 19, 2022
Merged

always set accept/accept-language headers when making a self-request#7722
Rich-Harris merged 1 commit into
masterfrom
gh-7720

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

closes #7720. We previously decided not to automatically include request headers, but I think these exceptions are valid. Given that accept is used within Kit for content negotiation purposes, it makes sense to default it to */* if unspecified. Similarly, if accept-language were to be used for i18n purposes, it makes sense for it to match the initial page request.

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. In many cases, features are absent for a reason. For large changes, please create an RFC: https://github.com/sveltejs/rfcs
  • This message body should clearly illustrate what problems it solves.
  • Ideally, include a test that fails without this PR but passes with it.

Tests

  • Run the tests with pnpm test and lint the project with pnpm lint and pnpm check

Changesets

  • If your PR makes a change that should be noted in one or more packages' changelogs, generate a changeset by running pnpm changeset and following the prompts. All changesets should be patch until SvelteKit 1.0

@changeset-bot

changeset-bot Bot commented Nov 19, 2022

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d8b0b54

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sveltejs/kit Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@benmccann benmccann left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

awesome. thanks!

@Rich-Harris
Rich-Harris merged commit d71b8b4 into master Nov 19, 2022
@Rich-Harris
Rich-Harris deleted the gh-7720 branch November 19, 2022 14:18
Rich-Harris pushed a commit that referenced this pull request Jul 28, 2026
)

#7722 added `accept-language` inheritance below the `authorization`
inheritance without porting its null guard, so when the incoming request
has no `Accept-Language` (requests made during prerendering never do),
every internal sub-request gets the literal string `null`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

internal fetch request is not initialized correctly

3 participants