Skip to content

return 308s instead of 301s when normalising paths - #9351

Merged
Rich-Harris merged 2 commits into
masterfrom
gh-9350
Mar 7, 2023
Merged

return 308s instead of 301s when normalising paths#9351
Rich-Harris merged 2 commits into
masterfrom
gh-9350

Conversation

@Rich-Harris

Copy link
Copy Markdown
Member

fixes #9350

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. Changesets that add features should be minor and those that fix bugs should be patch. Please prefix changeset messages with feat:, fix:, or chore:.

@Rich-Harris
Rich-Harris merged commit 8114c65 into master Mar 7, 2023
@Rich-Harris
Rich-Harris deleted the gh-9350 branch March 7, 2023 15:16
@github-actions github-actions Bot mentioned this pull request Mar 8, 2023
Rich-Harris pushed a commit that referenced this pull request Aug 18, 2026
…ge to the correct trailing slash (#16836)

The trailing-slash redirect for prerendered pages in
`exports/vite/preview/index.js` writes an absolute `location` from the
pathname the middleware sees, but that middleware runs inside
`scoped(base, ...)`, which has already stripped `paths.base`. With a
base path the browser lands on `/nested/` instead of `/base/nested/`.
Production (#9351) and adapter-node (#16431) send a relative location
for this reason and use 308; preview now does the same via
`relative_pathname`.

---------

Co-authored-by: Nic Polumeyv <nicolas.polum@gmail.com>
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.

HTTP 307 redirects break when normalizing URLs

2 participants