Hello community, here is the log from the commit of package rubygem-faraday_middleware for openSUSE:Factory checked in at 2019-06-19 20:59:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-faraday_middleware (Old) and /work/SRC/openSUSE:Factory/.rubygem-faraday_middleware.new.4811 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-faraday_middleware" Wed Jun 19 20:59:44 2019 rev:12 rq:705987 version:0.13.1 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-faraday_middleware/rubygem-faraday_middleware.changes 2017-09-26 21:13:32.365845712 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-faraday_middleware.new.4811/rubygem-faraday_middleware.changes 2019-06-19 20:59:44.278052977 +0200 @@ -1,0 +2,6 @@ +Sat Mar 2 15:13:51 UTC 2019 - Stephan Kulow <co...@suse.com> + +- updated to version 0.13.1 + no changelog found + +------------------------------------------------------------------- Old: ---- faraday_middleware-0.12.2.gem New: ---- faraday_middleware-0.13.1.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-faraday_middleware.spec ++++++ --- /var/tmp/diff_new_pack.0dGBy5/_old 2019-06-19 20:59:45.006053628 +0200 +++ /var/tmp/diff_new_pack.0dGBy5/_new 2019-06-19 20:59:45.006053628 +0200 @@ -1,7 +1,7 @@ # # spec file for package rubygem-faraday_middleware # -# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2019 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 @@ -12,7 +12,7 @@ # license that conforms to the Open Source Definition (Version 1.9) # published by the Open Source Initiative. -# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# Please submit bugfixes or comments via https://bugs.opensuse.org/ # @@ -24,7 +24,7 @@ # Name: rubygem-faraday_middleware -Version: 0.12.2 +Version: 0.13.1 Release: 0 %define mod_name faraday_middleware %define mod_full_name %{mod_name}-%{version} @@ -33,7 +33,7 @@ BuildRequires: %{ruby} BuildRequires: ruby-macros >= 5 Url: https://github.com/lostisland/faraday_middleware -Source: http://rubygems.org/gems/%{mod_full_name}.gem +Source: https://rubygems.org/gems/%{mod_full_name}.gem Source1: gem2rpm.yml Summary: Various middleware for Faraday License: MIT ++++++ faraday_middleware-0.12.2.gem -> faraday_middleware-0.13.1.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/README.md new/README.md --- old/README.md 2017-08-03 17:43:53.000000000 +0200 +++ new/README.md 2019-02-04 13:52:03.000000000 +0100 @@ -10,13 +10,14 @@ Some dependent libraries are needed only when using specific middleware: -* FaradayMiddleware::EncodeJson & FaradayMiddleware::ParseJson: "json" - for ruby older than 1.9 -* FaradayMiddleware::ParseXml: "multi_xml" -* FaradayMiddleware::OAuth: "simple_oauth" -* FaradayMiddleware::Mashify: "hashie" -* FaradayMiddleware::Rashify: "rash_alt" (Make sure to uninstall original rash gem to avoid conflict) -* FaradayMiddleware::Instrumentation: "activesupport" +| Middleware | Library | Notes | +| --------------------------- | -------------- | ----- | +| [FaradayMiddleware::Instrumentation](https://github.com/lostisland/faraday_middleware/blob/master/lib/faraday_middleware/instrumentation.rb) | [`activesupport`](https://rubygems.org/gems/activesupport) | | +| [FaradayMiddleware::OAuth](https://github.com/lostisland/faraday_middleware/blob/master/lib/faraday_middleware/request/oauth.rb) | [`simple_oauth`](https://rubygems.org/gems/simple_oauth) | | +| [FaradayMiddleware::ParseXml](https://github.com/lostisland/faraday_middleware/blob/master/lib/faraday_middleware/response/parse_xml.rb) | [`multi_xml`](https://rubygems.org/gems/multi_xml) | | +| [FaradayMiddleware::ParseYaml](https://github.com/lostisland/faraday_middleware/blob/master/lib/faraday_middleware/response/parse_yaml.rb) | [`safe_yaml`](https://rubygems.org/gems/safe_yaml) | Not backwards compatible with versions of this middleware prior to `faraday_middleware` v0.12. See code comments for alternatives. | +| [FaradayMiddleware::Mashify](https://github.com/lostisland/faraday_middleware/blob/master/lib/faraday_middleware/response/mashify.rb) | [`hashie`](https://rubygems.org/gems/hashie) | | +| [FaradayMiddleware::Rashify](https://github.com/lostisland/faraday_middleware/blob/master/lib/faraday_middleware/response/rashify.rb) | [`rash_alt`](https://rubygems.org/gems/rash_alt) | Make sure to uninstall original `rash` gem to avoid conflict. | Examples -------- Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/faraday_middleware/addressable_patch.rb new/lib/faraday_middleware/addressable_patch.rb --- old/lib/faraday_middleware/addressable_patch.rb 2017-08-03 17:43:53.000000000 +0200 +++ new/lib/faraday_middleware/addressable_patch.rb 1970-01-01 01:00:00.000000000 +0100 @@ -1,20 +0,0 @@ -require 'addressable/uri' - -# feature-detect the bug -unless Addressable::URI.parse('/?a=1&b=2') === '/?b=2&a=1' - # fix `normalized_query` by sorting query key-value pairs - # (rejected: https://github.com/sporkmonger/addressable/issues/28) - class Addressable::URI - alias normalized_query_without_ordering_fix normalized_query - - def normalized_query - fresh = @normalized_query.nil? - query = normalized_query_without_ordering_fix - if query && fresh - @normalized_query = query.split('&', -1).sort_by {|q| q[0..(q.index('=')||-1)] }.join('&') - else - query - end - end - end -end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/faraday_middleware/backwards_compatibility.rb new/lib/faraday_middleware/backwards_compatibility.rb --- old/lib/faraday_middleware/backwards_compatibility.rb 2017-08-03 17:43:53.000000000 +0200 +++ new/lib/faraday_middleware/backwards_compatibility.rb 2019-02-04 13:52:03.000000000 +0100 @@ -1,15 +1,18 @@ # deprecated constants -Faraday::Request.class_eval do - autoload :OAuth, 'faraday_middleware/request/oauth' - autoload :OAuth2, 'faraday_middleware/request/oauth2' -end +module Faraday + class Request + autoload :OAuth, 'faraday_middleware/request/oauth' + autoload :OAuth2, 'faraday_middleware/request/oauth2' + end -Faraday::Response.class_eval do - autoload :Mashify, 'faraday_middleware/response/mashify' - autoload :Rashify, 'faraday_middleware/response/rashify' - autoload :ParseJson, 'faraday_middleware/response/parse_json' - autoload :ParseXml, 'faraday_middleware/response/parse_xml' - autoload :ParseMarshal, 'faraday_middleware/response/parse_marshal' - autoload :ParseYaml, 'faraday_middleware/response/parse_yaml' + class Response + autoload :Mashify, 'faraday_middleware/response/mashify' + autoload :Rashify, 'faraday_middleware/response/rashify' + autoload :ParseJson, 'faraday_middleware/response/parse_json' + autoload :ParseXml, 'faraday_middleware/response/parse_xml' + autoload :ParseMarshal, 'faraday_middleware/response/parse_marshal' + autoload :ParseYaml, 'faraday_middleware/response/parse_yaml' + end end + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/faraday_middleware/gzip.rb new/lib/faraday_middleware/gzip.rb --- old/lib/faraday_middleware/gzip.rb 2017-08-03 17:43:53.000000000 +0200 +++ new/lib/faraday_middleware/gzip.rb 2019-02-04 13:52:03.000000000 +0100 @@ -13,10 +13,25 @@ class Gzip < Faraday::Middleware dependency 'zlib' + def self.optional_dependency(lib = nil) + lib ? require(lib) : yield + true + rescue LoadError, NameError + false + end + + BROTLI_SUPPORTED = optional_dependency 'brotli' + + def self.supported_encodings + encodings = %w[gzip deflate] + encodings << 'br' if BROTLI_SUPPORTED + encodings + end + ACCEPT_ENCODING = 'Accept-Encoding'.freeze CONTENT_ENCODING = 'Content-Encoding'.freeze CONTENT_LENGTH = 'Content-Length'.freeze - SUPPORTED_ENCODINGS = 'gzip,deflate'.freeze + SUPPORTED_ENCODINGS = supported_encodings.join(',').freeze RUBY_ENCODING = '1.9'.respond_to?(:force_encoding) def call(env) @@ -27,6 +42,8 @@ reset_body(response_env, &method(:uncompress_gzip)) when 'deflate' reset_body(response_env, &method(:inflate)) + when 'br' + reset_body(response_env, &method(:brotli_inflate)) end end end @@ -60,5 +77,9 @@ inflate.close end end + + def brotli_inflate(body) + Brotli.inflate(body) + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/faraday_middleware/response/caching.rb new/lib/faraday_middleware/response/caching.rb --- old/lib/faraday_middleware/response/caching.rb 2017-08-03 17:43:53.000000000 +0200 +++ new/lib/faraday_middleware/response/caching.rb 2019-02-04 13:52:03.000000000 +0100 @@ -1,7 +1,6 @@ require 'faraday' require 'forwardable' -# fixes normalizing query strings: -require 'faraday_middleware/addressable_patch' if defined? ::Addressable::URI +require 'digest/sha1' module FaradayMiddleware # Public: Caches GET responses and pulls subsequent ones from the cache. @@ -22,7 +21,7 @@ # Public: initialize the middleware. # - # cache - An object that responds to read, write and fetch (default: nil). + # cache - An object that responds to read and write (default: nil). # options - An options Hash (default: {}): # :ignore_params - String name or Array names of query params # that should be ignored when forming the cache @@ -66,7 +65,8 @@ url.query = params.any? ? build_query(params) : nil end url.normalize! - url.request_uri + + Digest::SHA1.hexdigest(url.request_uri) end def params_to_ignore diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/faraday_middleware/response/follow_redirects.rb new/lib/faraday_middleware/response/follow_redirects.rb --- old/lib/faraday_middleware/response/follow_redirects.rb 2017-08-03 17:43:53.000000000 +0200 +++ new/lib/faraday_middleware/response/follow_redirects.rb 2019-02-04 13:52:03.000000000 +0100 @@ -45,15 +45,24 @@ # the "%" character which we assume already represents an escaped sequence. URI_UNSAFE = /[^\-_.!~*'()a-zA-Z\d;\/?:@&=+$,\[\]%]/ + AUTH_HEADER = 'Authorization'.freeze + # Public: Initialize the middleware. # # options - An options Hash (default: {}): - # :limit - A Numeric redirect limit (default: 3) - # :standards_compliant - A Boolean indicating whether to respect + # :limit - A Numeric redirect limit (default: 3) + # :standards_compliant - A Boolean indicating whether to respect # the HTTP spec when following 301/302 # (default: false) - # :callback - A callable that will be called on redirects + # :callback - A callable that will be called on redirects # with the old and new envs + # :cookies - An Array of Strings (e.g. + # ['cookie1', 'cookie2']) to choose + # cookies to be kept, or :all to keep + # all cookies (default: []). + # :clear_authorization_header - A Boolean indicating whether the request + # Authorization header should be cleared on + # redirects (default: true) def initialize(app, options = {}) super(app) @options = options @@ -89,7 +98,9 @@ end def update_env(env, request_body, response) - env[:url] += safe_escape(response['location'] || '') + redirect_from_url = env[:url].to_s + redirect_to_url = safe_escape(response['location'] || '') + env[:url] += redirect_to_url if convert_to_get?(response) env[:method] = :get @@ -98,6 +109,8 @@ env[:body] = request_body end + clear_authorization_header(env, redirect_from_url, redirect_to_url) + ENV_TO_CLEAR.each {|key| env.delete key } env @@ -130,5 +143,21 @@ '%' + match.unpack('H2' * match.bytesize).join('%').upcase } end + + def clear_authorization_header(env, from_url, to_url) + return env if redirect_to_same_host?(from_url, to_url) + return env unless @options.fetch(:clear_authorization_header, true) + + env[:request_headers].delete(AUTH_HEADER) + end + + def redirect_to_same_host?(from_url, to_url) + return true if to_url.start_with?('/') + + from_uri = URI.parse(from_url) + to_uri = URI.parse(to_url) + + [from_uri.scheme, from_uri.host, from_uri.port] == [to_uri.scheme, to_uri.host, to_uri.port] + end end end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/faraday_middleware/version.rb new/lib/faraday_middleware/version.rb --- old/lib/faraday_middleware/version.rb 2017-08-03 17:43:53.000000000 +0200 +++ new/lib/faraday_middleware/version.rb 2019-02-04 13:52:03.000000000 +0100 @@ -1,3 +1,3 @@ module FaradayMiddleware - VERSION = '0.12.2' unless defined?(FaradayMiddleware::VERSION) + VERSION = '0.13.1' unless defined?(FaradayMiddleware::VERSION) end diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2017-08-03 17:43:53.000000000 +0200 +++ new/metadata 2019-02-04 13:52:03.000000000 +0100 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: faraday_middleware version: !ruby/object:Gem::Version - version: 0.12.2 + version: 0.13.1 platform: ruby authors: - Erik Michaels-Ober @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2017-08-03 00:00:00.000000000 Z +date: 2019-02-04 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: faraday @@ -42,7 +42,6 @@ - LICENSE.md - README.md - lib/faraday_middleware.rb -- lib/faraday_middleware/addressable_patch.rb - lib/faraday_middleware/backwards_compatibility.rb - lib/faraday_middleware/gzip.rb - lib/faraday_middleware/instrumentation.rb @@ -82,8 +81,7 @@ - !ruby/object:Gem::Version version: '0' requirements: [] -rubyforge_project: -rubygems_version: 2.6.11 +rubygems_version: 3.0.2 signing_key: specification_version: 4 summary: Various middleware for Faraday