http_router icon indicating copy to clipboard operation
http_router copied to clipboard

(.:format) parsing ignoring multiple periods in last parameter

Open adamlwatson opened this issue 13 years ago • 0 comments

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

adamlwatson avatar Dec 15 '11 20:12 adamlwatson