Skip to content
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

API Routing Fix #12

Merged
merged 5 commits into from
Mar 22, 2020
Merged

API Routing Fix #12

merged 5 commits into from
Mar 22, 2020

Conversation

zshafiqu
Copy link
Owner

@zshafiqu zshafiqu commented Mar 22, 2020

From Issue #11

Browsers can detect whether or not a trailing slash is there. Certain interfaces such as the CLI can't as there is a redirect that occurs.

For example –

$ ~ curl https://www.vehicleinfo.org/api/2002/acura/tl

Would yield an error at the command line. However,

$ ~ curl https://www.vehicleinfo.org/api/2002/acura/tl/

works as expected. This is a simple fix with editing some of the API's setup. Will look into this deeper when I have some time after finals are over.

Remedy –
Use non-trailing slashes on all application routes, and set application property for strict slashes to false in order to allow both request types to be processed.

@zshafiqu zshafiqu linked an issue Mar 22, 2020 that may be closed by this pull request
@zshafiqu zshafiqu merged commit bdbb289 into master Mar 22, 2020
@zshafiqu zshafiqu deleted the api-route-fix branch April 11, 2020 23:13
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.

Trailing slash for API routes
1 participant