mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/rss/parser.rb, lib/rss/atom.rb, lib/rss/rss.rb,
test/rss/rss-assertions.rb, test/rss/test_atom.rb: use pack/unpack("m") instead of base64 library. * lib/webrick/httpproxy.rb: use delete("\n") instead of chomp/chop because the result of pack("m") might be multi-line. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14303 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
192ec21adf
commit
06591ad6b1
7 changed files with 15 additions and 9 deletions
|
@ -1,3 +1,12 @@
|
||||||
|
Tue Dec 18 22:11:50 2007 GOTOU Yuuzou <gotoyuzo@notwork.org>
|
||||||
|
|
||||||
|
* lib/rss/parser.rb, lib/rss/atom.rb, lib/rss/rss.rb,
|
||||||
|
test/rss/rss-assertions.rb, test/rss/test_atom.rb: use
|
||||||
|
pack/unpack("m") instead of base64 library.
|
||||||
|
|
||||||
|
* lib/webrick/httpproxy.rb: use delete("\n") instead of chomp/chop
|
||||||
|
because the result of pack("m") might be multi-line.
|
||||||
|
|
||||||
Tue Dec 18 22:12:35 2007 Koichi Sasada <ko1@atdot.net>
|
Tue Dec 18 22:12:35 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* insnhelper.ci, vm.c: rewrite sp manipulation around method/block
|
* insnhelper.ci, vm.c: rewrite sp manipulation around method/block
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
require 'base64'
|
|
||||||
require 'rss/parser'
|
require 'rss/parser'
|
||||||
|
|
||||||
module RSS
|
module RSS
|
||||||
|
|
|
@ -474,7 +474,7 @@ module RSS
|
||||||
else
|
else
|
||||||
if klass.have_content?
|
if klass.have_content?
|
||||||
if @last_element.need_base64_encode?
|
if @last_element.need_base64_encode?
|
||||||
text = Base64.decode64(text.lstrip)
|
text = text.lstrip.unpack("m").first
|
||||||
end
|
end
|
||||||
@last_element.content = text
|
@last_element.content = text
|
||||||
end
|
end
|
||||||
|
|
|
@ -1201,7 +1201,7 @@ EOC
|
||||||
__send__(self.class.xml_getter).to_s
|
__send__(self.class.xml_getter).to_s
|
||||||
else
|
else
|
||||||
_content = content
|
_content = content
|
||||||
_content = Base64.encode64(_content) if need_base64_encode?
|
_content = [_content].pack("m").delete("\n") if need_base64_encode?
|
||||||
h(_content)
|
h(_content)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -118,8 +118,7 @@ module WEBrick
|
||||||
proxy_host = proxy.host
|
proxy_host = proxy.host
|
||||||
proxy_port = proxy.port
|
proxy_port = proxy.port
|
||||||
if proxy.userinfo
|
if proxy.userinfo
|
||||||
credentials = "Basic " + [proxy.userinfo].pack("m*")
|
credentials = "Basic " + [proxy.userinfo].pack("m").delete("\n")
|
||||||
credentials.chomp!
|
|
||||||
header['proxy-authorization'] = credentials
|
header['proxy-authorization'] = credentials
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -179,8 +178,7 @@ module WEBrick
|
||||||
if proxy = proxy_uri(req, res)
|
if proxy = proxy_uri(req, res)
|
||||||
proxy_request_line = "CONNECT #{host}:#{port} HTTP/1.0"
|
proxy_request_line = "CONNECT #{host}:#{port} HTTP/1.0"
|
||||||
if proxy.userinfo
|
if proxy.userinfo
|
||||||
credentials = "Basic " + [proxy.userinfo].pack("m*")
|
credentials = "Basic " + [proxy.userinfo].pack("m").delete("\n")
|
||||||
credentials.chomp!
|
|
||||||
end
|
end
|
||||||
host, port = proxy.host, proxy.port
|
host, port = proxy.host, proxy.port
|
||||||
end
|
end
|
||||||
|
|
|
@ -570,7 +570,7 @@ EOA
|
||||||
text << char
|
text << char
|
||||||
char.succ!
|
char.succ!
|
||||||
end
|
end
|
||||||
base64_content = Base64.encode64(Zlib::Deflate.deflate(text))
|
base64_content = [Zlib::Deflate.deflate(text)].pack("m").delete("\n")
|
||||||
|
|
||||||
[false, true].each do |with_space|
|
[false, true].each do |with_space|
|
||||||
xml_content = base64_content
|
xml_content = base64_content
|
||||||
|
|
|
@ -658,7 +658,7 @@ module RSS
|
||||||
content.content = original_content
|
content.content = original_content
|
||||||
xml = REXML::Document.new(content.to_s).root
|
xml = REXML::Document.new(content.to_s).root
|
||||||
assert_rexml_element([], {"type" => type},
|
assert_rexml_element([], {"type" => type},
|
||||||
Base64.encode64(original_content), xml)
|
[original_content].pack("m").delete("\n"), xml)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue