swifter icon indicating copy to clipboard operation
swifter copied to clipboard

Routing regression in 1.4.7

Open danoconnor opened this issue 6 years ago • 1 comments

Routing behavior for variable paths has changed in 1.4.7 compared to 1.4.6. The variable path can no longer match multiple sub-paths.

For example, I have this route: "/foo/bar/:path"

I expect it to be able to match anything after "foo/bar/", such as "foo/bar/a/b/c". As of 1.4.6, the HttpRouter behaved as expected, but this change (line 116 of HttpRouter.swift) that was released with 1.4.7 added a new behavior that requires the path to be the same length as the route.

Now, the route will only match on a path such as '"foo/bar/a"' and will not match on '"foo/bar/a/b"', since the path goes deeper than the length of the route.

Was this an intentional change or can this be reverted to the old behavior?

danoconnor avatar Jan 06 '20 21:01 danoconnor

You can read more about it here https://github.com/httpswift/swifter/issues/405.

Vkt0r avatar Jan 07 '20 15:01 Vkt0r