* add support to hex/%u encode a URI
git-svn-id: file:///home/svn/incoming/trunk@3517 4d416f70-5f16-0410-b530-b9f4589650daunstable
parent
ca315abe1b
commit
1351ceed1c
|
@ -138,6 +138,20 @@ class Request < Packet
|
||||||
str.sub!(/^[\/]+/, '/') # only one beginning slash!
|
str.sub!(/^[\/]+/, '/') # only one beginning slash!
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# / can't be encoded on most web servers...
|
||||||
|
if self.uri_encode_mode
|
||||||
|
case self.uri_encode_mode
|
||||||
|
when 'hex-all'
|
||||||
|
str = escape(str, 1).gsub!(/%2f/i, '/')
|
||||||
|
when 'hex-normal'
|
||||||
|
str = escape(str).gsub!(/%2f/i, '/')
|
||||||
|
when 'u-normal'
|
||||||
|
str = escape(str).gsub!(/%2f/i, '/').gsub!(/%/,'%u00')
|
||||||
|
when 'u-all'
|
||||||
|
str = escape(str, 1).gsub!(/%2f/i, '/').gsub!(/%/,'%u00')
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
if !PostRequests.include?(self.method)
|
if !PostRequests.include?(self.method)
|
||||||
if param_string.size > 0
|
if param_string.size > 0
|
||||||
str += '?' + param_string
|
str += '?' + param_string
|
||||||
|
@ -296,6 +310,9 @@ class Request < Packet
|
||||||
# add junk pipeline requests
|
# add junk pipeline requests
|
||||||
attr_accessor :junk_pipeline
|
attr_accessor :junk_pipeline
|
||||||
|
|
||||||
|
# encoding uri
|
||||||
|
attr_accessor :uri_encode_mode
|
||||||
|
|
||||||
protected
|
protected
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in New Issue