How do I automatically add slash to end of a url in spray routing?

北战南征 提交于 2019-12-04 05:23:49

问题


It's common practice for web servers to automatically redirect users to a URL ending in a slash when that URL represents a "directory". For example, entering http://www.apache.org/licenses into a browser redirects to http://www.apache.org/licenses/ automatically.

Due to the way spray's path-segment-based route matching works, I can't see an obvious way to create this behavior for a specific path segment. Any ideas?

来源:https://stackoverflow.com/questions/19556196/how-do-i-automatically-add-slash-to-end-of-a-url-in-spray-routing

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!