excon 0.71.0 → 0.71.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/excon/connection.rb +3 -3
- data/lib/excon/socket.rb +1 -1
- data/lib/excon/utils.rb +11 -5
- data/lib/excon/version.rb +1 -1
- 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: 3483232c53e58e83330497b888ceb5ae8caf357a3a420877c4a7fe215c42bc90
|
4
|
+
data.tar.gz: c6234ea3046151ac74b16863a86cf0aae15d442b50c8ec714fe0d948ec8d5e16
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 39a91a0d66433b6f48fe656a6bdd76bf60a337d0f6a6f1410f059b76efcc8dfba5f45b8dd5219b6501a90fb1e36c546611f54f8cd25df81556ede72d449cd6bf
|
7
|
+
data.tar.gz: fa742b6d91232d626cc109a98f12fe2584ae33bf12caecb847a8021236f3619a4eed09c48a3b4e6a9f8b1a758b4f5144536db7b821f50d1b991bdcbcbbb5342b
|
data/lib/excon/connection.rb
CHANGED
@@ -161,7 +161,7 @@ module Excon
|
|
161
161
|
socket.write(request) # write out request + headers
|
162
162
|
while true # write out body with chunked encoding
|
163
163
|
chunk = datum[:request_block].call
|
164
|
-
binary_encode(chunk)
|
164
|
+
chunk = binary_encode(chunk)
|
165
165
|
if chunk.length > 0
|
166
166
|
socket.write(chunk.length.to_s(16) << CR_NL << chunk << CR_NL)
|
167
167
|
else
|
@@ -180,10 +180,10 @@ module Excon
|
|
180
180
|
end
|
181
181
|
|
182
182
|
# if request + headers is less than chunk size, fill with body
|
183
|
-
binary_encode(request)
|
183
|
+
request = binary_encode(request)
|
184
184
|
chunk = body.read([datum[:chunk_size] - request.length, 0].max)
|
185
185
|
if chunk
|
186
|
-
binary_encode(chunk)
|
186
|
+
chunk = binary_encode(chunk)
|
187
187
|
socket.write(request << chunk)
|
188
188
|
else
|
189
189
|
socket.write(request) # write out request + headers
|
data/lib/excon/socket.rb
CHANGED
data/lib/excon/utils.rb
CHANGED
@@ -12,7 +12,13 @@ module Excon
|
|
12
12
|
|
13
13
|
def binary_encode(string)
|
14
14
|
if FORCE_ENC && string.encoding != Encoding::ASCII_8BIT
|
15
|
-
string.
|
15
|
+
if string.frozen?
|
16
|
+
string.dup.force_encoding('BINARY')
|
17
|
+
else
|
18
|
+
string.force_encoding('BINARY')
|
19
|
+
end
|
20
|
+
else
|
21
|
+
string
|
16
22
|
end
|
17
23
|
end
|
18
24
|
|
@@ -89,7 +95,7 @@ module Excon
|
|
89
95
|
def split_header_value(str)
|
90
96
|
return [] if str.nil?
|
91
97
|
str = str.dup.strip
|
92
|
-
binary_encode(str)
|
98
|
+
str = binary_encode(str)
|
93
99
|
str.scan(%r'\G((?:"(?:\\.|[^"])+?"|[^",]+)+)
|
94
100
|
(?:,\s*|\Z)'xn).flatten
|
95
101
|
end
|
@@ -97,21 +103,21 @@ module Excon
|
|
97
103
|
# Escapes HTTP reserved and unwise characters in +str+
|
98
104
|
def escape_uri(str)
|
99
105
|
str = str.dup
|
100
|
-
binary_encode(str)
|
106
|
+
str = binary_encode(str)
|
101
107
|
str.gsub(UNESCAPED) { "%%%02X" % $1[0].ord }
|
102
108
|
end
|
103
109
|
|
104
110
|
# Unescapes HTTP reserved and unwise characters in +str+
|
105
111
|
def unescape_uri(str)
|
106
112
|
str = str.dup
|
107
|
-
binary_encode(str)
|
113
|
+
str = binary_encode(str)
|
108
114
|
str.gsub(ESCAPED) { $1.hex.chr }
|
109
115
|
end
|
110
116
|
|
111
117
|
# Unescape form encoded values in +str+
|
112
118
|
def unescape_form(str)
|
113
119
|
str = str.dup
|
114
|
-
binary_encode(str)
|
120
|
+
str = binary_encode(str)
|
115
121
|
str.gsub!(/\+/, ' ')
|
116
122
|
str.gsub(ESCAPED) { $1.hex.chr }
|
117
123
|
end
|
data/lib/excon/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.71.
|
4
|
+
version: 0.71.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- dpiddy (Dan Peterson)
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2019-12-
|
13
|
+
date: 2019-12-18 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rspec
|