Skip to content

fix: preserve query string on automatic redirects#232

Open
WilliamK112 wants to merge 1 commit intovercel:mainfrom
WilliamK112:178-preserve-query-cleanurl
Open

fix: preserve query string on automatic redirects#232
WilliamK112 wants to merge 1 commit intovercel:mainfrom
WilliamK112:178-preserve-query-cleanurl

Conversation

@WilliamK112
Copy link
Copy Markdown

Summary

  • preserve the original query string for serve-handler's automatic redirects
  • limit the behavior change to cleanUrls and trailingSlash redirects
  • add integration coverage for both redirect paths

Problem

Requests such as /directory/clean-file.html?foo=bar currently redirect to /directory/clean-file, dropping the original query string. The same thing happens for automatic trailing slash redirects.

Scope

This patch keeps the change narrow on purpose: it preserves the query string only for redirects generated internally by cleanUrls and trailingSlash. It does not change the behavior of user-configured redirects.

Testing

  • corepack yarn build-views
  • corepack yarn jest test/integration.test.js --runInBand --forceExit

Fixes #178

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.

.html is stripped along with query params from URL

1 participant