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

Stop address bar from adding trailing slash to query params #1820

Merged
merged 1 commit into from
Sep 29, 2024

Conversation

brandonpayton
Copy link
Member

@brandonpayton brandonpayton commented Sep 28, 2024

Motivation for the change, related issues

Before this change, adding query params to a dir URI in the address bar would lead to the address bar adding a trailing slash after the query params.

For example, entering /?query=param would become /?query=param/, which is undesired and incorrect.

Thanks to @bgrgicak for pointing this out in #1789.

Implementation details

Since the PHP request handler already redirects dir URIs to include a trailing slash, we can remove this code and stop the bug from happening.

Testing Instructions (or ideally a Blueprint)

  • Run a dev server
  • Enter /?test=query in the Playground web app address bar
  • Confirm that no trailing slash is added in the address bar

Before this change, adding query params to a dir URI
in the address bar would lead to the address bar adding
a trailing slash after the query params. Since the PHP
request handler already redirects dir URIs to include
a trailing slash, we can remove this code and stop
the bug from happening.
@brandonpayton brandonpayton added [Type] Bug An existing feature does not function as intended [Package][@wp-playground] Website labels Sep 28, 2024
@brandonpayton brandonpayton requested a review from a team September 28, 2024 17:19
@brandonpayton brandonpayton self-assigned this Sep 28, 2024
@adamziel adamziel merged commit 81c45f6 into trunk Sep 29, 2024
6 checks passed
@adamziel adamziel deleted the stop-forcing-trailing-slash-in-address-bar branch September 29, 2024 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Package][@wp-playground] Website [Type] Bug An existing feature does not function as intended
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants