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

Fix issue 1056 handling the trailing slash #1219

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Lloyd-Pottiger
Copy link

http://sparkjava.com/documentation#redirects, method doesn't seem to work when I try to add the trailing slash. And it does not match trailing slashes with a mapped route. So it considers /api/test and /api/test/ as different URIs. This commit solve thoese problem with little change in code. The changed file: src/main/java/spark/http/matching/MatcherFilter.java line 107, add

108 if (uri.length() > 1 && uri.endsWith("/"))
109           uri = uri.substring(0, uri.length() - 1);

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.

1 participant