diff --git a/CHANGELOG.md b/CHANGELOG.md index 3db1b7a..28f8f5d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,8 @@ -## 1.6.3 - 2023-02-25 +## 1.7.0 - 2024-06-08 + +* [#138](https://github.com/trusche/httplog/pull/138) Support for Faraday v2 + +## 1.6.3 - 2024-02-25 * Dependecy updates * [#137](https://github.com/trusche/httplog/pull/137) Fix case sensitivity on response headers diff --git a/Gemfile.lock b/Gemfile.lock index 5bb70aa..e6fc62a 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -21,29 +21,12 @@ GEM ffi (>= 1.15.0) eventmachine (1.2.7) excon (0.109.0) - faraday (1.10.3) - faraday-em_http (~> 1.0) - faraday-em_synchrony (~> 1.0) - faraday-excon (~> 1.1) - faraday-httpclient (~> 1.0) - faraday-multipart (~> 1.0) - faraday-net_http (~> 1.0) - faraday-net_http_persistent (~> 1.0) - faraday-patron (~> 1.0) - faraday-rack (~> 1.0) - faraday-retry (~> 1.0) - ruby2_keywords (>= 0.0.4) - faraday-em_http (1.0.0) - faraday-em_synchrony (1.0.0) - faraday-excon (1.1.0) - faraday-httpclient (1.0.1) + faraday (2.9.0) + faraday-net_http (>= 2.0, < 3.2) faraday-multipart (1.0.4) multipart-post (~> 2) - faraday-net_http (1.0.1) - faraday-net_http_persistent (1.2.0) - faraday-patron (1.0.0) - faraday-rack (1.0.0) - faraday-retry (1.0.3) + faraday-net_http (3.1.0) + net-http ffi (1.16.3) ffi-compiler (1.0.1) ffi (>= 1.0.0) @@ -92,6 +75,8 @@ GEM multi_xml (0.6.0) multipart-post (2.4.0) nenv (0.3.0) + net-http (0.4.1) + uri netrc (0.11.0) notiffany (0.1.3) nenv (~> 0.1) @@ -127,7 +112,6 @@ GEM diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.13.0) rspec-support (3.13.1) - ruby2_keywords (0.0.5) shellany (0.0.1) simplecov (0.22.0) docile (~> 1.1) @@ -142,6 +126,7 @@ GEM thor (1.3.0) typhoeus (1.4.1) ethon (>= 0.9.0) + uri (0.13.0) PLATFORMS ruby @@ -149,7 +134,8 @@ PLATFORMS DEPENDENCIES ethon (~> 0.11) excon (~> 0.60) - faraday (~> 1.3) + faraday (>= 1.3) + faraday-multipart (>= 1.0) guard-rspec (~> 4.7) http (>= 4.0) httparty (~> 0.16) diff --git a/httplog.gemspec b/httplog.gemspec index 69ce709..87bb65c 100644 --- a/httplog.gemspec +++ b/httplog.gemspec @@ -32,7 +32,8 @@ Gem::Specification.new do |gem| gem.add_development_dependency 'ethon', ['~> 0.11'] gem.add_development_dependency 'excon', ['~> 0.60'] - gem.add_development_dependency 'faraday', ['~> 1.3'] + gem.add_development_dependency 'faraday', ['>= 1.3'] + gem.add_development_dependency 'faraday-multipart', ['>= 1.0'] gem.add_development_dependency 'guard-rspec', ['~> 4.7'] gem.add_development_dependency 'http', ['>= 4.0'] gem.add_development_dependency 'httparty', ['~> 0.16'] diff --git a/spec/adapters/faraday_adapter.rb b/spec/adapters/faraday_adapter.rb index 654ced1..6325922 100644 --- a/spec/adapters/faraday_adapter.rb +++ b/spec/adapters/faraday_adapter.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true require 'faraday' +require 'faraday/multipart' + class FaradayAdapter < HTTPBaseAdapter def send_get_request connection.get do |req| @@ -33,7 +35,7 @@ def send_post_form_request end def send_multipart_post_request - file_upload = Faraday::UploadIO.new(@params['file'], 'text/plain') + file_upload = Faraday::Multipart::FilePart.new(@params['file'], 'text/plain') connection.post do |req| req.url parse_uri.to_s @@ -54,7 +56,7 @@ def self.response_string_for(response) def connection Faraday.new(url: "#{@protocol}://#{@host}:#{@port}") do |faraday| - faraday.request :multipart + # faraday.request :multipart faraday.request :url_encoded faraday.adapter Faraday.default_adapter # make requests with Net::HTTP