excon 0.44.0 → 0.44.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of excon might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/changelog.txt +5 -0
- data/excon.gemspec +2 -2
- data/lib/excon/constants.rb +1 -1
- data/lib/excon/utils.rb +4 -1
- data/tests/basic_tests.rb +20 -12
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 481bfd91390599d3d4e0dfc27838fddc748adbf3
|
4
|
+
data.tar.gz: 0a6a75c64591bcb78f4a763667913c0a89e4ae8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6584d40bdf128fb820816775fa9fffd5504facd85704e8dec3e41c98a209e5dc8ca918d1ad7fb4662ae0f83cb556cb4ab782742c208170d3d0e62fc68b66b6e
|
7
|
+
data.tar.gz: 1942bd6aca9b73b82eb8a9a9b00cefb6b438416eaf85b53d4985d407a6d5bedcbac55df0e655817ba1c5a34a83f3e62b538e6b48554f5185b1a482d16bd30fee
|
data/Gemfile.lock
CHANGED
data/changelog.txt
CHANGED
data/excon.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'excon'
|
16
|
-
s.version = '0.44.
|
17
|
-
s.date = '2015-
|
16
|
+
s.version = '0.44.1'
|
17
|
+
s.date = '2015-02-02'
|
18
18
|
s.rubyforge_project = 'excon'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
data/lib/excon/constants.rb
CHANGED
data/lib/excon/utils.rb
CHANGED
@@ -56,7 +56,7 @@ module Excon
|
|
56
56
|
# Splits a header value +str+ according to HTTP specification.
|
57
57
|
def split_header_value(str)
|
58
58
|
return [] if str.nil?
|
59
|
-
str = str.strip
|
59
|
+
str = str.dup.strip
|
60
60
|
str.force_encoding('BINARY') if FORCE_ENC
|
61
61
|
str.scan(%r'\G((?:"(?:\\.|[^"])+?"|[^",]+)+)
|
62
62
|
(?:,\s*|\Z)'xn).flatten
|
@@ -64,18 +64,21 @@ module Excon
|
|
64
64
|
|
65
65
|
# Escapes HTTP reserved and unwise characters in +str+
|
66
66
|
def escape_uri(str)
|
67
|
+
str = str.dup
|
67
68
|
str.force_encoding('BINARY') if FORCE_ENC
|
68
69
|
str.gsub(UNESCAPED) { "%%%02X" % $1[0].ord }
|
69
70
|
end
|
70
71
|
|
71
72
|
# Unescapes HTTP reserved and unwise characters in +str+
|
72
73
|
def unescape_uri(str)
|
74
|
+
str = str.dup
|
73
75
|
str.force_encoding('BINARY') if FORCE_ENC
|
74
76
|
str.gsub(ESCAPED) { $1.hex.chr }
|
75
77
|
end
|
76
78
|
|
77
79
|
# Unescape form encoded values in +str+
|
78
80
|
def unescape_form(str)
|
81
|
+
str = str.dup
|
79
82
|
str.force_encoding('BINARY') if FORCE_ENC
|
80
83
|
str.gsub!(/\+/, ' ')
|
81
84
|
str.gsub(ESCAPED) { $1.hex.chr }
|
data/tests/basic_tests.rb
CHANGED
@@ -89,19 +89,27 @@ end
|
|
89
89
|
Shindo.tests('Excon basics (Basic Auth Pass)') do
|
90
90
|
with_rackup('basic_auth.ru') do
|
91
91
|
basic_tests('http://test_user:test_password@127.0.0.1:9292')
|
92
|
+
tests('with frozen args').returns(200) do
|
93
|
+
user, pass, uri = ['test_user', 'test_password', 'http://127.0.0.1:9292'].map(&:freeze)
|
94
|
+
connection = Excon.new(uri, :user => user, :password => pass )
|
95
|
+
response = connection.request(:method => :get, :path => '/content-length/100')
|
96
|
+
response.status
|
97
|
+
end
|
98
|
+
end
|
99
|
+
end
|
92
100
|
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
]
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
101
|
+
Shindo.tests('Excon basics (Basic Auth Fail)') do
|
102
|
+
with_rackup('basic_auth.ru') do
|
103
|
+
cases = [
|
104
|
+
['correct user, no password', 'http://test_user@127.0.0.1:9292'],
|
105
|
+
['correct user, wrong password', 'http://test_user:fake_password@127.0.0.1:9292'],
|
106
|
+
['wrong user, correct password', 'http://fake_user:test_password@127.0.0.1:9292']
|
107
|
+
]
|
108
|
+
cases.each do |desc,url|
|
109
|
+
tests("response.status for #{desc}").returns(401) do
|
110
|
+
connection = Excon.new(url)
|
111
|
+
response = connection.request(:method => :get, :path => '/content-length/100')
|
112
|
+
response.status
|
105
113
|
end
|
106
114
|
end
|
107
115
|
end
|
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.44.
|
4
|
+
version: 0.44.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: 2015-
|
13
|
+
date: 2015-02-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|