Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- removed the encoded method alltogether

  • Loading branch information...
commit f7604281595e6e2902eec62fb9c7b443cfd5cb81 1 parent 1371153
@niko authored
Showing with 1 addition and 5 deletions.
  1. +1 −5 lib/sinatra/base.rb
View
6 lib/sinatra/base.rb
@@ -1222,7 +1222,7 @@ def compile!(verb, path, block, options = {})
def compile(path)
keys = []
if path.respond_to? :to_str
- pattern = path.to_str.gsub(/[^\?\%\\\/\:\*\w\ ]/) { |c| encoded(c) }
+ pattern = path.to_str.gsub(/[^\?\%\\\/\:\*\w\ ]/) { |c| "(?:#{Regexp.escape c})" }
pattern.gsub!(/((:\w+)|\*)/) do |match|
if match == "*"
keys << 'splat'
@@ -1244,10 +1244,6 @@ def compile(path)
end
end
- def encoded(char)
- "(?:#{Regexp.escape char}|#{URI.encode char, /./})"
- end
-
public
# Makes the methods defined in the block and in the Modules given
# in `extensions` available to the handlers and templates
Please sign in to comment.
Something went wrong with that request. Please try again.