commit
634245d569
|
@ -36,13 +36,13 @@ class HttpRouter
|
|||
instance_eval <<-EOT, __FILE__, __LINE__ + 1
|
||||
def generate(args, options)
|
||||
generated_path = \"#{code}\"
|
||||
#{validation_regex.inspect}.match(generated_path) ? URI.escape(generated_path) : nil
|
||||
#{validation_regex.inspect}.match(generated_path) ? URI::DEFAULT_PARSER.escape(generated_path) : nil
|
||||
end
|
||||
EOT
|
||||
else
|
||||
instance_eval <<-EOT, __FILE__, __LINE__ + 1
|
||||
def generate(args, options)
|
||||
URI.escape(\"#{code}\")
|
||||
URI::DEFAULT_PARSER.escape(\"#{code}\")
|
||||
end
|
||||
EOT
|
||||
end
|
||||
|
@ -147,4 +147,4 @@ class HttpRouter
|
|||
uri
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -7,7 +7,7 @@ class HttpRouter
|
|||
|
||||
def initialize(path, rack_request)
|
||||
@rack_request = rack_request
|
||||
@path = URI.unescape(path).split(/\//)
|
||||
@path = URI::DEFAULT_PARSER.unescape(path).split(/\//)
|
||||
@path.shift if @path.first == ''
|
||||
@path.push('') if path[-1] == ?/
|
||||
@extra_env = {}
|
||||
|
@ -27,4 +27,4 @@ class HttpRouter
|
|||
@path.size == 0 or @path.size == 1 && @path.first == ''
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue