Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest versions of Parse Server and the Parse JS SDK.
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:
http://localhost:1337/parse//hooks/functions
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
- Parse Server version:
7.4.0
Client - Parse JS SDK version:
5.3.0