-
Notifications
You must be signed in to change notification settings - Fork 369
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: don't mistake paths for protocols #6212
Changes from 3 commits
40250e8
146cb80
de73e77
cb5a139
a39ca0b
f205690
225e790
11a54b7
5024ba8
01171e6
9f5b9a2
9bf539b
d4a8a24
e5e8c08
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -297,8 +297,8 @@ export class FunctionsRegistry { | |
async getFunctionForURLPath(url, method) { | ||
// We're constructing a URL object just so that we can extract the path from | ||
// the incoming URL. It doesn't really matter that we don't have the actual | ||
// local URL with the correct port. | ||
const urlPath = new URL(url, 'http://localhost').pathname | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is nothing ensuring that There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've played around with it a bit more, and it seems like we had this in place to remove query parameters from the path. 146cb80 implements a fix that still does that |
||
// local URL with the correct port.) | ||
Skn0tt marked this conversation as resolved.
Show resolved
Hide resolved
|
||
const urlPath = new URL(`http://localhost${url}`).pathname | ||
const defaultURLMatch = urlPath.match(DEFAULT_FUNCTION_URL_EXPRESSION) | ||
|
||
if (defaultURLMatch) { | ||
|
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 parameter should probably be named to
urlPath
, as it will now break if it's a fully qualified URL? Alternatively, we can keep it asurl
and check whether if it's a full URL or a URL path, adjusting accordingly.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.
done in f205690