lib/jets/resource/api_gateway/rest_api/routes/change/base.rb in jets-1.6.5 vs lib/jets/resource/api_gateway/rest_api/routes/change/base.rb in jets-1.6.6
- old
+ new
@@ -41,11 +41,11 @@
end
memoize :deployed_routes
def recreate_path(path)
path = path.gsub(%r{^/},'')
- path = path.sub(/{(.*)\+}/, '*\1')
- path.sub(/{(.*)}/, ':\1')
+ path = path.gsub(/{([^}]*)\+}/, '*\1')
+ path.gsub(/{([^}]*)}/, ':\1')
end
def to(resource_id, http_method)
uri = method_uri(resource_id, http_method)
recreate_to(uri) unless uri.nil?
\ No newline at end of file