Reverted fix for #1078
Relaxed the requirement for the route to start with a slash (#1938)
Merge slashes when prefix ends and pattern starts with a slash (#1938)
Test case for #1938