intridea/grape — Issue #127: compile_path uses dots/periods as a seperator
Author: RobertLowe
Created: 2012-01-25 20:46:29+00:00
State: open

Hi,

I've fixed an issue where a paramater with dots/periods would not route correctly because dots/periods are considered separators. Is this right, if so why? Can anyone think of problems with patching like this?

Offending code:

get ':person_email', :archor => false do
# eg: example@example.com
end

---

Patched code:

def compile_path(prepared_path, anchor = true)
endpoint_options = {}
endpoint_options[:version] = /#{settings[:version].join('|')}/ if settings[:version]
# Rack::Mount::Strexp.compile(prepared_path, endpoint_options, %w( / . ? ), anchor)
Rack::Mount::Strexp.compile(prepared_path, endpoint_options, %w( / ? ), anchor)
end