Hello community,
here is the log from the commit of package rubygem-httpclient for
openSUSE:Factory checked in at 2016-03-18 21:39:06
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/rubygem-httpclient (Old)
and /work/SRC/openSUSE:Factory/.rubygem-httpclient.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-httpclient"
Changes:
--------
--- /work/SRC/openSUSE:Factory/rubygem-httpclient/rubygem-httpclient.changes
2015-12-14 10:13:59.000000000 +0100
+++
/work/SRC/openSUSE:Factory/.rubygem-httpclient.new/rubygem-httpclient.changes
2016-03-18 21:39:07.000000000 +0100
@@ -1,0 +2,6 @@
+Thu Jan 21 05:37:01 UTC 2016 - [email protected]
+
+- updated to version 2.7.1
+ no changelog found
+
+-------------------------------------------------------------------
Old:
----
httpclient-2.7.0.1.gem
New:
----
httpclient-2.7.1.gem
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ rubygem-httpclient.spec ++++++
--- /var/tmp/diff_new_pack.FPLjzs/_old 2016-03-18 21:39:08.000000000 +0100
+++ /var/tmp/diff_new_pack.FPLjzs/_new 2016-03-18 21:39:08.000000000 +0100
@@ -1,7 +1,7 @@
#
# spec file for package rubygem-httpclient
#
-# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -24,7 +24,7 @@
#
Name: rubygem-httpclient
-Version: 2.7.0.1
+Version: 2.7.1
Release: 0
%define mod_name httpclient
%define mod_full_name %{mod_name}-%{version}
++++++ httpclient-2.7.0.1.gem -> httpclient-2.7.1.gem ++++++
Files old/checksums.yaml.gz and new/checksums.yaml.gz differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/httpclient/cookie.rb new/lib/httpclient/cookie.rb
--- old/lib/httpclient/cookie.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/lib/httpclient/cookie.rb 2016-01-01 15:52:04.000000000 +0100
@@ -3,9 +3,12 @@
begin # for catching LoadError and load webagent-cookie instead
require 'http-cookie'
+require 'httpclient/util'
class HTTPClient
class CookieManager
+ include HTTPClient::Util
+
attr_reader :format, :jar
attr_accessor :cookies_file
@@ -68,7 +71,7 @@
end
def find(uri)
- warn('CookieManager#find is deprecated and will be removed in near
future. Use HTTP::Cookie.cookie_value(CookieManager#cookies) instead')
+ warning('CookieManager#find is deprecated and will be removed in near
future. Use HTTP::Cookie.cookie_value(CookieManager#cookies) instead')
if cookie = cookies(uri)
HTTP::Cookie.cookie_value(cookie)
end
@@ -174,8 +177,7 @@
CookieManager = ::HTTPClient::CookieManager
class Cookie < HTTP::Cookie
- @@domain_warned = false
- @@warned = false
+ include HTTPClient::Util
def url
deprecated('url', 'origin')
@@ -195,7 +197,7 @@
alias original_domain domain
def domain
- domain_warning
+ warning('Cookie#domain returns dot-less domain name now. Use
Cookie#dot_domain if you need "." at the beginning.')
self.original_domain
end
@@ -206,18 +208,8 @@
private
- def domain_warning
- unless @@domain_warned
- warn('Cookie#domain returns dot-less domain name now. Use
Cookie#dot_domain if you need "." at the beginning.')
- @@domain_warned = true
- end
- end
-
def deprecated(old, new)
- unless @@warned
- warn("WebAgent::Cookie is deprecated and will be replaced with
HTTP::Cookie in the near future. Please use Cookie##{new} instead of
Cookie##{old} for the replacement.")
- @@warned = true
- end
+ warning("WebAgent::Cookie is deprecated and will be replaced with
HTTP::Cookie in the near future. Please use Cookie##{new} instead of
Cookie##{old} for the replacement.")
end
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/httpclient/http.rb new/lib/httpclient/http.rb
--- old/lib/httpclient/http.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/lib/httpclient/http.rb 2016-01-01 15:52:04.000000000 +0100
@@ -12,6 +12,7 @@
if defined?(Encoding::ASCII_8BIT)
require 'open-uri' # for encoding
end
+require 'httpclient/util'
# A namespace module for HTTP Message definitions used by HTTPClient.
@@ -95,6 +96,7 @@
# p res.header['last-modified'].first
#
class Message
+ include HTTPClient::Util
CRLF = "\r\n"
@@ -980,12 +982,12 @@
VERSION_WARNING = 'Message#version (Float) is deprecated. Use
Message#http_version (String) instead.'
def version
- warn(VERSION_WARNING)
+ warning(VERSION_WARNING)
@http_header.http_version.to_f
end
def version=(version)
- warn(VERSION_WARNING)
+ warning(VERSION_WARNING)
@http_header.http_version = version
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/httpclient/jruby_ssl_socket.rb
new/lib/httpclient/jruby_ssl_socket.rb
--- old/lib/httpclient/jruby_ssl_socket.rb 2015-11-07 16:00:43.000000000
+0100
+++ new/lib/httpclient/jruby_ssl_socket.rb 2016-01-01 15:52:04.000000000
+0100
@@ -315,7 +315,7 @@
def add(file_or_dir)
return if file_or_dir == :default
if File.directory?(file_or_dir)
- warn('directory not yet supported')
+ warn("#{file_or_dir}: directory not yet supported")
else
pem = nil
File.read(file_or_dir).each_line do |line|
@@ -447,7 +447,7 @@
if config.ssl_version == :auto
ssl_version = DEFAULT_SSL_PROTOCOL
else
- ssl_version = config.to_s.gsub(/_/, '.')
+ ssl_version = config.ssl_version.to_s.gsub(/_/, '.')
end
unless config.cert_store_crl_items.empty?
raise NotImplementedError.new('Manual CRL configuration is not yet
supported')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/httpclient/session.rb
new/lib/httpclient/session.rb
--- old/lib/httpclient/session.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/lib/httpclient/session.rb 2016-01-01 15:52:04.000000000 +0100
@@ -14,6 +14,7 @@
require 'socket'
require 'thread'
+require 'timeout'
require 'stringio'
require 'zlib'
@@ -497,7 +498,7 @@
# Use absolute URI (not absolute path) iif via proxy AND not HTTPS.
req.header.request_absolute_uri = [email protected]? && !https?(@dest)
begin
- timeout(@send_timeout, SendTimeoutError) do
+ ::Timeout.timeout(@send_timeout, SendTimeoutError) do
set_header(req)
req.dump(@socket)
# flush the IO stream as IO::sync mode is false
@@ -731,7 +732,7 @@
site = @proxy || @dest
retry_number = 0
begin
- timeout(@connect_timeout, ConnectTimeoutError) do
+ ::Timeout.timeout(@connect_timeout, ConnectTimeoutError) do
if str = @test_loopback_http_response.shift
@socket = create_loopback_socket(site.host, site.port, str)
elsif https?(@dest)
@@ -784,7 +785,7 @@
StatusParseRegexp = %r(\AHTTP/(\d+\.\d+)\s+(\d\d\d)\s*([^\r\n]+)?\r?\n\z)
def parse_header(socket)
- timeout(@receive_timeout, ReceiveTimeoutError) do
+ ::Timeout.timeout(@receive_timeout, ReceiveTimeoutError) do
initial_line = nil
begin
begin
@@ -864,7 +865,7 @@
buf = empty_bin_str
maxbytes = @read_block_size
maxbytes = @content_length if maxbytes > @content_length &&
@content_length > 0
- timeout(@receive_timeout, ReceiveTimeoutError) do
+ ::Timeout.timeout(@receive_timeout, ReceiveTimeoutError) do
begin
@socket.readpartial(maxbytes, buf)
rescue EOFError
@@ -897,7 +898,7 @@
@socket.gets(RS)
return
end
- timeout(@receive_timeout, ReceiveTimeoutError) do
+ ::Timeout.timeout(@receive_timeout, ReceiveTimeoutError) do
@socket.read(@chunk_length, buf)
@socket.read(2)
end
@@ -914,7 +915,7 @@
end
while true
buf = empty_bin_str
- timeout(@receive_timeout, ReceiveTimeoutError) do
+ ::Timeout.timeout(@receive_timeout, ReceiveTimeoutError) do
begin
@socket.readpartial(@read_block_size, buf)
rescue EOFError
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/httpclient/ssl_config.rb
new/lib/httpclient/ssl_config.rb
--- old/lib/httpclient/ssl_config.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/lib/httpclient/ssl_config.rb 2016-01-01 15:52:04.000000000 +0100
@@ -35,6 +35,7 @@
# You may want to change trust anchor by yourself. Call clear_cert_store
# then add_trust_ca for that purpose.
class SSLConfig
+ include HTTPClient::Util
include OpenSSL if SSLEnabled
CIPHERS_DEFAULT = "ALL:!aNULL:!eNULL:!SSLv2" # OpenSSL >1.0.0 default
@@ -446,11 +447,14 @@
(ver.start_with?('OpenSSL ') && ver >= 'OpenSSL 1.0.2d') ||
defined?(JRuby)
filename = 'cacert.pem'
else
- warn("RSA 1024 bit CA certificates are loaded due to old openssl
compatibility")
+ warning("RSA 1024 bit CA certificates are loaded due to old openssl
compatibility")
filename = 'cacert1024.pem'
end
file = File.join(File.dirname(__FILE__), filename)
- add_trust_ca_to_store(cert_store, file)
+ unless defined?(JRuby)
+ # JRuby uses @cert_store_items
+ add_trust_ca_to_store(cert_store, file)
+ end
@cert_store_items << file
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/httpclient/util.rb new/lib/httpclient/util.rb
--- old/lib/httpclient/util.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/lib/httpclient/util.rb 2016-01-01 15:52:04.000000000 +0100
@@ -198,6 +198,16 @@
end
module_function :try_require
+ # show one warning message only once by caching message
+ #
+ # it cached all messages in memory so be careful not to show many kinds of
warning message.
+ @@__warned = {}
+ def warning(message)
+ return if @@__warned.key?(message)
+ warn(message)
+ @@__warned[message] = true
+ end
+
# Checks if the given URI is https.
def https?(uri)
uri.scheme && uri.scheme.downcase == 'https'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/httpclient/version.rb
new/lib/httpclient/version.rb
--- old/lib/httpclient/version.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/lib/httpclient/version.rb 2016-01-01 15:52:04.000000000 +0100
@@ -1,3 +1,3 @@
class HTTPClient
- VERSION = '2.7.0.1'
+ VERSION = '2.7.1'
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/httpclient/webagent-cookie.rb
new/lib/httpclient/webagent-cookie.rb
--- old/lib/httpclient/webagent-cookie.rb 2015-11-07 16:00:43.000000000
+0100
+++ new/lib/httpclient/webagent-cookie.rb 2016-01-01 15:52:04.000000000
+0100
@@ -456,4 +456,4 @@
class HTTPClient
CookieManager = WebAgent::CookieManager
-end
+end unless defined?(HTTPClient::CookieManager)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/lib/httpclient.rb new/lib/httpclient.rb
--- old/lib/httpclient.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/lib/httpclient.rb 2016-01-01 15:52:04.000000000 +0100
@@ -393,10 +393,25 @@
#
# After you set :base_url, all resources you pass to get, post and other
# methods are recognized to be prefixed with base_url. Say base_url is
- # 'https://api.example.com/v1, get('/users') is the same as
+ # 'https://api.example.com/v1/, get('users') is the same as
# get('https://api.example.com/v1/users') internally. You can also pass
# full URL from 'http://' even after setting base_url.
#
+ # The expected base_url and path behavior is the following. Please take
+ # care of '/' in base_url and path.
+ #
+ # The last '/' is important for base_url:
+ # 1. http://foo/bar/baz/ + path -> http://foo/bar/baz/path
+ # 2. http://foo/bar/baz + path -> http://foo/bar/path
+ # Relative path handling:
+ # 3. http://foo/bar/baz/ + ../path -> http://foo/bar/path
+ # 4. http://foo/bar/baz + ../path -> http://foo/path
+ # 5. http://foo/bar/baz/ + ./path -> http://foo/bar/baz/path
+ # 6. http://foo/bar/baz + ./path -> http://foo/bar/path
+ # The leading '/' of path means absolute path:
+ # 7. http://foo/bar/baz/ + /path -> http://foo/path
+ # 8. http://foo/bar/baz + /path -> http://foo/path
+ #
# :default_header is for providing default headers Hash that all HTTP
# requests should have, such as custom 'Authorization' header in API.
# You can override :default_header with :header Hash parameter in HTTP
@@ -703,9 +718,9 @@
def default_redirect_uri_callback(uri, res)
newuri = urify(res.header['location'][0])
if !http?(newuri) && !https?(newuri)
- newuri = uri + newuri
- warn("could be a relative URI in location header which is not
recommended")
+ warn("#{newuri}: a relative URI in location header which is not
recommended")
warn("'The field value consists of a single absolute URI' in HTTP spec")
+ newuri = uri + newuri
end
if https?(uri) && !https?(newuri)
raise BadResponseError.new("redirecting to non-https resource")
@@ -1133,7 +1148,7 @@
boundary = nil
if body
_, content_type = header.find { |key, value|
- key.downcase == 'content-type'
+ key.to_s.downcase == 'content-type'
}
if content_type
if /\Amultipart/ =~ content_type
@@ -1142,7 +1157,7 @@
else
boundary = create_boundary
content_type = "#{content_type}; boundary=#{boundary}"
- header = override_header(header, 'Content-Type', content_type)
+ header = override_header(header, 'content-type', content_type)
end
end
else
@@ -1180,7 +1195,7 @@
def override_header(header, key, value)
result = []
header.each do |k, v|
- if k.downcase == key.downcase
+ if k.to_s.downcase == key
result << [key, value]
else
result << [k, v]
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/metadata new/metadata
--- old/metadata 2015-11-07 16:00:43.000000000 +0100
+++ new/metadata 2016-01-01 15:52:04.000000000 +0100
@@ -1,14 +1,14 @@
--- !ruby/object:Gem::Specification
name: httpclient
version: !ruby/object:Gem::Version
- version: 2.7.0.1
+ version: 2.7.1
platform: ruby
authors:
- Hiroshi Nakamura
autorequire:
bindir: bin
cert_chain: []
-date: 2015-11-07 00:00:00.000000000 Z
+date: 2016-01-01 00:00:00.000000000 Z
dependencies: []
description:
email: [email protected]
@@ -103,7 +103,7 @@
version: '0'
requirements: []
rubyforge_project:
-rubygems_version: 2.4.5.1
+rubygems_version: 2.5.1
signing_key:
specification_version: 4
summary: gives something like the functionality of libwww-perl (LWP) in Ruby
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/test_auth.rb new/test/test_auth.rb
--- old/test/test_auth.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/test/test_auth.rb 2016-01-01 15:52:04.000000000 +0100
@@ -465,6 +465,7 @@
# TODO: WEBrick server returns ECONNRESET/EPIPE before sending
Unauthorized response to client?
raise if retry_times > 5
retry_times += 1
+ sleep 1
retry
end
end
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/test_httpclient.rb new/test/test_httpclient.rb
--- old/test/test_httpclient.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/test/test_httpclient.rb 2016-01-01 15:52:04.000000000 +0100
@@ -115,6 +115,14 @@
assert_equal("Accept: text/html", lines[4])
end
+ def test_header_symbol
+ str = ""
+ @client.debug_dev = str
+ @client.post(serverurl + 'servlet', :header => {:'Content-Type' =>
'application/json'}, :body => 'hello')
+ lines = str.split(/(?:\r?\n)+/).grep(/^Content-Type/)
+ assert_equal(2, lines.size) # 1 for both request and response
+ end
+
def test_host_given
str = ""
@client.debug_dev = str
@@ -138,7 +146,7 @@
def test_redirect_returns_not_modified
assert_nothing_raised do
- timeout(2) do
+ ::Timeout.timeout(2) do
@client.get(serverurl + 'status', {:status => 306}, {:follow_redirect
=> true})
end
end
@@ -531,7 +539,7 @@
def test_no_content
assert_nothing_raised do
- timeout(2) do
+ ::Timeout.timeout(2) do
@client.get(serverurl + 'status', :status => 101)
@client.get(serverurl + 'status', :status => 204)
@client.get(serverurl + 'status', :status => 304)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/test/test_ssl.rb new/test/test_ssl.rb
--- old/test/test_ssl.rb 2015-11-07 16:00:43.000000000 +0100
+++ new/test/test_ssl.rb 2016-01-01 15:52:04.000000000 +0100
@@ -11,7 +11,6 @@
super
@serverpid = @client = nil
@verify_callback_called = false
- @verbose, $VERBOSE = $VERBOSE, nil
setup_server
setup_client
@url = "https://localhost:#{serverport}/hello"
@@ -19,7 +18,6 @@
def teardown
super
- $VERBOSE = @verbose
end
def path(filename)