Inconsistent behaviour while creating a template from a URI
Opened this issue · 0 comments
achamian commented
Executing following code
base = 'http://foo.com/api/xml'.to_uri
p base.to_template("bar/:id").uri_pattern
base = 'http://foo.com/api/xml/'.to_uri
p base.to_template("bar/:id").uri_pattern
base = 'http://foo.com/api/xml'.to_uri
p base.to_template("/bar/:id").uri_pattern
Produces
"http://foo.com/api/xml/bar/:id" # Expected behaviour (Considering p base["/bar"].uri_string to be standard)
Note that 'xml' is dropped in first case where as only base path is considered in last.