Skip to content

Fix the entrypoint missing the path prefix #115

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

Merged

Conversation

Deuchnord
Copy link
Contributor

@Deuchnord Deuchnord commented Apr 6, 2019

Q A
Bug fix? yes
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets none
License MIT
Doc PR none

When you create an app with your API endpoints on a subpath, for instance, http://yoursite.tld/api, the /api part of the URL was lost because of a behaviour of the JS URL prototype.
This PR solves that. Basically, it checks if the ENTRYPOINT has a trailing slash. If it doesn’t, the trailing slash is added, so the path is well appended to the URL.

Plus, we now use the URL.href property instead of the toString() function.

@Deuchnord Deuchnord force-pushed the fix/entrypoint-with-path-prefix branch 2 times, most recently from 6548698 to 0d88c6f Compare April 6, 2019 19:08
@Deuchnord Deuchnord force-pushed the fix/entrypoint-with-path-prefix branch from 0d88c6f to 0d6cb54 Compare April 6, 2019 19:23
@Deuchnord Deuchnord force-pushed the fix/entrypoint-with-path-prefix branch from 0d6cb54 to 271700f Compare April 6, 2019 19:25
@soyuka soyuka merged commit d9e38cc into api-platform:master Apr 6, 2019
@Deuchnord Deuchnord deleted the fix/entrypoint-with-path-prefix branch April 7, 2019 07:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants