ethon 0.10.0 → 0.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -1
- data/lib/ethon/easy/header.rb +1 -7
- data/lib/ethon/version.rb +1 -1
- data/spec/ethon/easy/header_spec.rb +0 -30
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3cc64826630c9f25f87d4a4140a9cecc43575994
|
4
|
+
data.tar.gz: 01f6e1dc05161204a18eabe86e64c941fcb5bda1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d98725e35b6e1d81fcd4f2b1207d54f178e058230b2bbf49249e94e4ff05067d8e7a5e6cdfb7be2465ac7a2c6f8b4a7145e5bf9e291817dd0e1661c87816f595
|
7
|
+
data.tar.gz: a60d5cd6436990a8f58d3ef5c2eb47167998b6ade221fdaa66e6464b2119d3a6e395e660ef17031dc72eec059f9b92dc0f4187e57b3d032dd30a5c29cd74f20b
|
data/CHANGELOG.md
CHANGED
@@ -2,7 +2,11 @@
|
|
2
2
|
|
3
3
|
## Master
|
4
4
|
|
5
|
-
[Full Changelog](https://github.com/typhoeus/ethon/compare/v0.10.
|
5
|
+
[Full Changelog](https://github.com/typhoeus/ethon/compare/v0.10.1...master)
|
6
|
+
|
7
|
+
## 0.10.1
|
8
|
+
|
9
|
+
[Full Changelog](https://github.com/typhoeus/ethon/compare/v0.10.0...v0.10.1)
|
6
10
|
|
7
11
|
## 0.10.0
|
8
12
|
|
data/lib/ethon/easy/header.rb
CHANGED
@@ -4,8 +4,6 @@ module Ethon
|
|
4
4
|
#
|
5
5
|
# @api private
|
6
6
|
module Header
|
7
|
-
EMPTY_STRING_VALUE = "".freeze
|
8
|
-
|
9
7
|
# Return headers, return empty hash if none.
|
10
8
|
#
|
11
9
|
# @example Return the headers.
|
@@ -55,11 +53,7 @@ module Ethon
|
|
55
53
|
#
|
56
54
|
# @return [ String ] The composed header.
|
57
55
|
def compose_header(key, value)
|
58
|
-
|
59
|
-
Util.escape_zero_byte("#{key};")
|
60
|
-
else
|
61
|
-
Util.escape_zero_byte("#{key}: #{value}")
|
62
|
-
end
|
56
|
+
Util.escape_zero_byte("#{key}: #{value}")
|
63
57
|
end
|
64
58
|
end
|
65
59
|
end
|
data/lib/ethon/version.rb
CHANGED
@@ -46,36 +46,6 @@ describe Ethon::Easy::Header do
|
|
46
46
|
expect(easy.response_body).to include('"HTTP_USER_AGENT":"Ethon"')
|
47
47
|
end
|
48
48
|
end
|
49
|
-
|
50
|
-
context "when header value is empty string" do
|
51
|
-
let(:headers) { { 'User-Agent' => "" } }
|
52
|
-
|
53
|
-
if(Ethon::Curl.version_info[:version] >= "7.23.0")
|
54
|
-
it "sends header with empty value" do
|
55
|
-
expect(easy.response_body).to include('"HTTP_USER_AGENT":""')
|
56
|
-
end
|
57
|
-
else
|
58
|
-
it "does not send header (curl < 7.23.0 does not support empty values)" do
|
59
|
-
expect(easy.response_body).to_not include('"HTTP_USER_AGENT"')
|
60
|
-
end
|
61
|
-
end
|
62
|
-
end
|
63
|
-
|
64
|
-
context "when header value is nil" do
|
65
|
-
let(:headers) { { 'User-Agent' => nil } }
|
66
|
-
|
67
|
-
it "does not send header" do
|
68
|
-
expect(easy.response_body).to_not include('"HTTP_USER_AGENT"')
|
69
|
-
end
|
70
|
-
end
|
71
|
-
|
72
|
-
context "when header value is integer" do
|
73
|
-
let(:headers) { { 'User-Agent' => 0 } }
|
74
|
-
|
75
|
-
it "sends as string" do
|
76
|
-
expect(easy.response_body).to include('"HTTP_USER_AGENT":"0"')
|
77
|
-
end
|
78
|
-
end
|
79
49
|
end
|
80
50
|
end
|
81
51
|
|