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

Added ignoreTrailingSlash router option #1632

Merged
merged 2 commits into from Mar 26, 2018

Conversation

delvedor
Copy link
Contributor

@delvedor delvedor commented Mar 26, 2018

Pre-Submission Checklist

  • Opened an issue discussing these changes before opening the PR
  • Ran the linter and tests via make prepush
  • Included comprehensive and convincing tests for changes

Issues

Closes:

Summarize the issues that discussed these changes

This is my first pr in this project and I didn't know the rule "Opened an issue discussing these changes before opening the PR". Since I've already did all the work I hope it is ok if I open it anyway. Sorry for the inconvenience.

Changes

Added ignoreTrailingSlash router option.

What does this PR do?

find-my-way does not support by default trailing slash in routes, so /path and /path/ are not the same thing (and the one with the trailing slash will be a 404).

If a user needs this specific behaviour it can pass { ignoreTrailingSlash: true } to find-my-way. The result will be that internally find-my-way will register two routes /path and /path/, this will be seen in the debug log.

This pr add the possibility to pass this option (and possibly more) to find-my-way.

@hekike can you review? Thanks.

@hekike
Copy link
Member

hekike commented Mar 26, 2018

This is awesome, thanks!

@hekike hekike self-requested a review March 26, 2018 17:17
@hekike hekike merged commit 92ffbf5 into restify:master Mar 26, 2018
@hekike
Copy link
Member

hekike commented Mar 26, 2018

Released as v7.1.0, thanks again!

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.

None yet

2 participants