Parse Hooks requests have double forward slash in URL (which is an issue for Express 5.x) #2406
Open
4 tasks done
Labels
type:bug
Impaired feature or lacking behavior that is likely assumed
New Issue Checklist
Issue Description
An Express 4.x oddity allowed requests to be made with a double forward slash in the URL if it was between the router and route (discussed here). This is an anti-pattern and shouldn't be allowed. It looks like because of the way some routes are created in this SDK, a double forward slash is automatically being added to some internal requests. This requires us to make Parse Server continue supporting double forward-slashes even though it's really not advisable.
It's fairly easy to track the issue down in the code. You can see paths that start with forward slashes here:
https://github.com/parse-community/Parse-SDK-JS/blob/alpha/src/ParseHooks.ts#L77
And then the REST controller checks if the Server URL ends with a forward slash and, if it doesn't it adds one before tacking on the path:
https://github.com/parse-community/Parse-SDK-JS/blob/alpha/src/RESTController.ts#L235
Steps to reproduce
Run any call that triggers an internal REST call to Hooks or (I think) Files and observe the URL used internally. You will see something like this:
I discovered this running Parse Server Hooks integration tests so that's another way to reproduce this issue.
Actual Outcome
Doubled up forward slashes.
Expected Outcome
The SDK should not be doubling up the forward slashes.
Server
7.4.0
Client
5.3.0
The text was updated successfully, but these errors were encountered: