joshbuddy/http_router — Issue #23: (.:format) parsing ignoring multiple periods in last parameter
Author: adamlwatson
Created: 2011-12-15 20:19:37+00:00
State: open

Hi Josh,

I am working with http_router within a Goliath 0.9.4 project. I have a route with a variable path segment at the end, of which the value can contain multiple periods. If I add in the (.:format) specifier, then everything following the first period in the value of this path segment is truncated.

For example, if I specify my route as such:

get '/foo/:bar(.:format)'

...and the incoming request looks like this:

http://localhost/foo/baz.bat.json

...then the resulting value I receive for the :bar parameter is just "baz" instead of "baz.bat".

Is there any workaround for this? I'm thinking that the (.:format) specifier should not be parsing out everything following the first period... it should be looking for the _last_ period in the parameter value.

Thanks,
Adam