Skip to content

Fix issue 1056 handling the trailing slash - #1219

Open
Lloyd-Pottiger wants to merge 2 commits into
perwendel:masterfrom
Lloyd-Pottiger:fix-issue-1056
Open

Fix issue 1056 handling the trailing slash#1219
Lloyd-Pottiger wants to merge 2 commits into
perwendel:masterfrom
Lloyd-Pottiger:fix-issue-1056

Conversation

@Lloyd-Pottiger

Copy link
Copy Markdown

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