Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(server): base middleware redirect with search and hash #6574

Conversation

cncolder
Copy link
Contributor

@cncolder cncolder commented Jan 20, 2022

Description

Retain search and hash when redirecting to the base path in the server base middleware. This is important when the initial search query is meaningful. e.g. an OAuth token. From http://localhost:3000/?code=12345 to http://localhost:3000/myapp/?code=12345

close #6573

Additional context

A minimal reproduce demo: https://stackblitz.com/edit/vitejs-vite-n6gkx1?file=vite.config.ts&terminal=dev


What is the purpose of this pull request?

  • Bug fix
  • New Feature
  • Documentation update
  • Other

Before submitting the PR, please make sure you do the following

  • Read the Contributing Guidelines.
  • Read the Pull Request Guidelines and follow the Commit Convention.
  • Check that there isn't already a PR that solves the problem the same way to avoid creating a duplicate.
  • Provide a description in this PR that addresses what the PR is solving, or reference the issue that it solves (e.g. fixes #123).
  • Ideally, include relevant tests that fail without this PR but pass with it.

@cncolder
Copy link
Contributor Author

Hi @antfu, ptal if you have a chance.

@Niputi
Copy link
Contributor

Niputi commented Jan 20, 2022

please don't mention people
we will get to pull requests as we do

@Niputi Niputi added the p2-nice-to-have Not breaking anything but nice to have (priority) label Feb 9, 2022
@patak-dev patak-dev added this to the 2.9 milestone Feb 9, 2022
@patak-dev patak-dev merged commit a516e85 into vitejs:main Mar 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p2-nice-to-have Not breaking anything but nice to have (priority)
Projects
No open projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

Retain search and hash when jumping to base.
5 participants