-
Notifications
You must be signed in to change notification settings - Fork 271
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
Request handler: Remove everything after # from the URL #1126
Conversation
Closes #1120 Fixes a bug in the URL parsing where `#foo` is passed to PHP when requesting `/index.php#foo`. ## Testing instructions Confirm the tests passed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change makes sense, and the tests pass. And the new test fails without the fix to php-request-handler.ts.
I went ahead and merged this since it is a simple change. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very nice change; in hindsight I realize we all should have noticed this.
@@ -119,7 +119,8 @@ export class PHPRequestHandler implements RequestHandler { | |||
request.url.startsWith('http://') || | |||
request.url.startsWith('https://'); | |||
const requestedUrl = new URL( | |||
request.url, | |||
// Remove the hash part of the URL as it's meant for the server. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There's something wrong with this comment. It should either say "it's not meant for the server" or "it's meant only for the client."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good spot!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 06f27eb
Closes #1120
Fixes a bug in the URL parsing where
#foo
is passed to PHP when requesting/index.php#foo
.Testing instructions
Confirm the tests passed