A self taught programmer with a passion to learn and update my skills.
- Calgary, Alberta
Pinned Loading
-
-
-
-
Remove / in Spark Java (Allow with /...
Remove / in Spark Java (Allow with / and without /) 1Spark.before((req, res) -> {
2String path = req.pathInfo();
3if (path.endsWith("/") && path.length() != 1) // length prevents redirect on homepage https://example.com/ <--
4res.redirect(path.substring(0, path.length() - 1));
5 -
Something went wrong, please refresh the page to try again.
If the problem persists, check the GitHub status page or contact support.
If the problem persists, check the GitHub status page or contact support.