问题
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