Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/httpclient/jruby_ssl_socket.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def initialize(socket, debug_dev = nil)
@outstr = @socket.getOutputStream
@instr = BufferedInputStream.new(@socket.getInputStream)
@buf = (' ' * BUF_SIZE).to_java_bytes
@bufstr = ''
@bufstr = ''.dup
end

def close
Expand Down Expand Up @@ -352,7 +352,7 @@ def add(cert_source)
File.read(cert_source).each_line do |line|
case line
when /-----BEGIN CERTIFICATE-----/
pem = ''
pem = ''.dup
when /-----END CERTIFICATE-----/
load_pem(pem)
# keep parsing in case where multiple certificates in a file
Expand Down
2 changes: 1 addition & 1 deletion test/helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
require 'webrick/httpproxy.rb'
require 'logger'
require 'stringio'
require 'cgi'
require 'cgi/escape'
require 'webrick/httputils'

if RUBY_ENGINE == 'jruby'
Expand Down
1 change: 1 addition & 0 deletions test/test_auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ def data_size
@active && @value ? @value.size : 0
end

remove_method(:value) if method_defined?(:value)
def value
@value ||= ""
end
Expand Down
6 changes: 3 additions & 3 deletions test/test_httpclient.rb
Original file line number Diff line number Diff line change
Expand Up @@ -768,15 +768,15 @@ def test_get_async_for_largebody
if RUBY_VERSION > "1.9"
def test_post_async_with_default_internal
original_encoding = Encoding.default_internal
Encoding.default_internal = Encoding::UTF_8
silent { Encoding.default_internal = Encoding::UTF_8 }
begin
post_body = StringIO.new("こんにちは")
conn = @client.post_async(serverurl + 'servlet', post_body)
Thread.pass while !conn.finished?
res = conn.pop
assert_equal 'post,こんにちは', res.content.read
ensure
Encoding.default_internal = original_encoding
silent { Encoding.default_internal = original_encoding }
end
end
end
Expand Down Expand Up @@ -934,7 +934,7 @@ def test_post_with_file
STDOUT.sync = true
File.open(__FILE__) do |file|
res = @client.post(serverurl + 'servlet', {1=>2, 3=>file})
assert_match(/^Content-Disposition: form-data; name="1"\r\n/nm, res.content)
assert_match(/^Content-Disposition: form-data; name="1"\r\n/m, res.content)
assert_match(/^Content-Disposition: form-data; name="3";/, res.content)
assert_match(/FIND_TAG_IN_THIS_FILE/, res.content)
end
Expand Down
Loading