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 +4 -4
- data/CHANGELOG.md +10 -0
- data/README.md +1 -0
- data/lib/webmock/http_lib_adapters/em_http_request_adapter.rb +1 -1
- data/lib/webmock/util/uri.rb +5 -4
- data/lib/webmock/version.rb +1 -1
- data/spec/acceptance/em_http_request/em_http_request_spec_helper.rb +1 -1
- data/spec/unit/util/uri_spec.rb +10 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 95babf82ad860e3ab49c323e66fcc785820dfecf100c03aa2fc126329e35c64a
|
4
|
+
data.tar.gz: 36d86569a52f5a999d9d2093a05a09fde833aaa669d94b94325ca11f03479027
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 34a48904414979c39edd9ee796172ea6a2018392b9a3a6e9ef28fc47b550e542f83c247382206e0d13fe51df8becd008f6b4e135976f7f08b3088fe13f680670
|
7
|
+
data.tar.gz: bb1a6e478680c68f109a0937f7b372a08e3f2a0385fa79386acae1ed5db35b679224376b62258472dcf55b66386166a8dcbf9c1580beb16938e439816f475873
|
data/CHANGELOG.md
CHANGED
@@ -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
@@ -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 ?
|
110
|
+
stubbed_webmock_response.should_timeout ? Errno::ETIMEDOUT : nil)
|
111
111
|
}
|
112
112
|
self
|
113
113
|
elsif WebMock.net_connect_allowed?(request_signature.uri)
|
data/lib/webmock/util/uri.rb
CHANGED
@@ -86,20 +86,21 @@ module WebMock
|
|
86
86
|
|
87
87
|
def self.uris_encoded_and_unencoded(uris)
|
88
88
|
uris.map do |uri|
|
89
|
-
[
|
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
|
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
|
data/lib/webmock/version.rb
CHANGED
data/spec/unit/util/uri_spec.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2019-09-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: addressable
|