webmock 3.7.1 → 3.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e772b611e0179353d7187a2e24a4d2e4afb894c8fcf60c439cf13cd3e64fdbe8
4
- data.tar.gz: 3de0ac09c6659b28c4ad2b9abb5fa69adc67e7e489c2c0979e84e826ee576c69
3
+ metadata.gz: 95babf82ad860e3ab49c323e66fcc785820dfecf100c03aa2fc126329e35c64a
4
+ data.tar.gz: 36d86569a52f5a999d9d2093a05a09fde833aaa669d94b94325ca11f03479027
5
5
  SHA512:
6
- metadata.gz: 44c7fa0892f5f0e1c1331287081bd3df86272b0843aeb34de8ea73a859dc8fb7ec3be24c5cd0ca83ff5cb699eadd5966fa9711e030d9a382f2a418c8d661bcfc
7
- data.tar.gz: 40e5a59b2189f8b19bf7eb4a034f08e1b657e54c8a6912b212852f402f60aaaee5897178e0c58db707db0c7ef9bc0aa6d28a5c72df83e43ce8f4846a5393c3a2
6
+ metadata.gz: 34a48904414979c39edd9ee796172ea6a2018392b9a3a6e9ef28fc47b550e542f83c247382206e0d13fe51df8becd008f6b4e135976f7f08b3088fe13f680670
7
+ data.tar.gz: bb1a6e478680c68f109a0937f7b372a08e3f2a0385fa79386acae1ed5db35b679224376b62258472dcf55b66386166a8dcbf9c1580beb16938e439816f475873
@@ -1,5 +1,15 @@
1
1
  # Changelog
2
2
 
3
+ ## 3.7.2
4
+
5
+ * Fixed handling of non UTF-8 encoded urls
6
+
7
+ Thanks to [Rafael França](https://github.com/rafaelfranca)
8
+
9
+ * Fixed "shadowing outer local variable" warning
10
+
11
+ Thanks to [y-yagi](https://github.com/y-yagi)
12
+
3
13
  ## 3.7.1
4
14
 
5
15
  * Fixed Async::HTTP::Client adapter code to not cause Ruby warning
data/README.md CHANGED
@@ -1108,6 +1108,7 @@ People who submitted patches and new features or suggested improvements. Many th
1108
1108
  * Fábio D. Batista
1109
1109
  * Andriy Yanko
1110
1110
  * y-yagi
1111
+ * Rafael França
1111
1112
 
1112
1113
 
1113
1114
  For a full list of contributors you can visit the
@@ -107,7 +107,7 @@ if defined?(EventMachine::HttpClient)
107
107
  @uri ||= nil
108
108
  EM.next_tick {
109
109
  setup(make_raw_response(stubbed_webmock_response), @uri,
110
- stubbed_webmock_response.should_timeout ? "WebMock timeout error" : nil)
110
+ stubbed_webmock_response.should_timeout ? Errno::ETIMEDOUT : nil)
111
111
  }
112
112
  self
113
113
  elsif WebMock.net_connect_allowed?(request_signature.uri)
@@ -86,20 +86,21 @@ module WebMock
86
86
 
87
87
  def self.uris_encoded_and_unencoded(uris)
88
88
  uris.map do |uri|
89
- [ uri.to_s, Addressable::URI.unencode(uri, String).freeze ]
89
+ [
90
+ uri.to_s.force_encoding(Encoding::ASCII_8BIT),
91
+ Addressable::URI.unencode(uri, String).force_encoding(Encoding::ASCII_8BIT).freeze
92
+ ]
90
93
  end.flatten
91
94
  end
92
95
 
93
96
  def self.uris_with_scheme_and_without(uris)
94
97
  uris.map { |uri|
95
- uri = uri.dup.force_encoding(Encoding::ASCII_8BIT) if uri.respond_to?(:force_encoding)
96
98
  [ uri, uri.gsub(%r{^https?://},"").freeze ]
97
99
  }.flatten
98
100
  end
99
101
 
100
102
  def self.uris_with_trailing_slash_and_without(uris)
101
- uris = uris.map { |uri|
102
- uri = uri.dup.force_encoding(Encoding::ASCII_8BIT) if uri.respond_to?(:force_encoding)
103
+ uris.map { |uri|
103
104
  [ uri, uri.omit(:path).freeze ]
104
105
  }.flatten
105
106
  end
@@ -1,3 +1,3 @@
1
1
  module WebMock
2
- VERSION = '3.7.1' unless defined?(::WebMock::VERSION)
2
+ VERSION = '3.7.2' unless defined?(::WebMock::VERSION)
3
3
  end
@@ -50,7 +50,7 @@ module EMHttpRequestSpecHelper
50
50
  end
51
51
 
52
52
  def client_timeout_exception_class
53
- "WebMock timeout error"
53
+ 'Errno::ETIMEDOUT'
54
54
  end
55
55
 
56
56
  def connection_refused_exception_class
@@ -177,6 +177,16 @@ describe WebMock::Util::URI do
177
177
  end
178
178
  end
179
179
 
180
+ it "should find all variations of uris with https, basic auth, a non-standard port and a path" do
181
+ uri = "https://~%8A:pass@www.example.com:9000/foo"
182
+ variations = [
183
+ "https://~%8A:pass@www.example.com:9000/foo",
184
+ "https://~\x8A:pass@www.example.com:9000/foo".force_encoding(Encoding::ASCII_8BIT)
185
+ ]
186
+
187
+ expect(WebMock::Util::URI.variations_of_uri_as_strings(uri)).to eq(variations)
188
+ end
189
+
180
190
  end
181
191
 
182
192
  describe "normalized uri equality" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webmock
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.7.1
4
+ version: 3.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bartosz Blimke
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-02 00:00:00.000000000 Z
11
+ date: 2019-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable