excon 0.44.2 → 0.44.3
Sign up to get free protection for your applications and to get access to all the features.
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 +6 -0
- data/excon.gemspec +3 -2
- data/lib/excon/constants.rb +1 -1
- data/lib/excon/middlewares/redirect_follower.rb +5 -1
- data/lib/excon/ssl_socket.rb +1 -1
- data/tests/middlewares/redirect_follower_tests.rb +17 -0
- data/tests/rackups/redirecting.ru +23 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7bab65841deb9f42b9995536b43ba90f2304bd43
|
4
|
+
data.tar.gz: 4aa257ec3673a05e2e8016cc07a4125ae3ec3a1e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1f36fccc8ef6fb09ff5d03cb58168fdb8c70bf40d859c3c83966b0fa8a075da12db7a78ae1f90f3e0df5a0e5a9217316fe5ff1c7039b3ba6f32db11dd1d7075
|
7
|
+
data.tar.gz: a350f3e660fbb4d8ee724bfca8e8b36107886f9e9127e0cf8418a0c104d1cde8a3c927f6f10d2c4d5983e81952de64c90779d34ca8462297c014832df0d88b04
|
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-02-
|
16
|
+
s.version = '0.44.3'
|
17
|
+
s.date = '2015-02-24'
|
18
18
|
s.rubyforge_project = 'excon'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
@@ -145,6 +145,7 @@ Gem::Specification.new do |s|
|
|
145
145
|
tests/rackups/deflater.ru
|
146
146
|
tests/rackups/proxy.ru
|
147
147
|
tests/rackups/query_string.ru
|
148
|
+
tests/rackups/redirecting.ru
|
148
149
|
tests/rackups/request_headers.ru
|
149
150
|
tests/rackups/request_methods.ru
|
150
151
|
tests/rackups/response_header.ru
|
data/lib/excon/constants.rb
CHANGED
@@ -17,7 +17,11 @@ module Excon
|
|
17
17
|
params = datum.dup
|
18
18
|
params.delete(:stack)
|
19
19
|
params.delete(:connection)
|
20
|
-
|
20
|
+
if [301, 302, 303].include?(response[:status])
|
21
|
+
params[:method] = :get
|
22
|
+
params.delete(:body)
|
23
|
+
params[:headers].delete('Content-Length')
|
24
|
+
end
|
21
25
|
params[:headers] = datum[:headers].dup
|
22
26
|
params[:headers].delete('Authorization')
|
23
27
|
params[:headers].delete('Proxy-Connection')
|
data/lib/excon/ssl_socket.rb
CHANGED
@@ -52,7 +52,7 @@ module Excon
|
|
52
52
|
begin
|
53
53
|
ssl_context.cert_store.add_file(ca_file)
|
54
54
|
rescue
|
55
|
-
Excon.display_warning("Excon unable to add file to cert store, ignoring: #{ca_file}\n[#{
|
55
|
+
Excon.display_warning("Excon unable to add file to cert store, ignoring: #{ca_file}\n[#{$!.class}] #{$!.message}")
|
56
56
|
end
|
57
57
|
end
|
58
58
|
|
@@ -61,3 +61,20 @@ Shindo.tests('Excon redirect support for relative Location headers') do
|
|
61
61
|
|
62
62
|
env_restore
|
63
63
|
end
|
64
|
+
|
65
|
+
Shindo.tests("Excon redirecting post request") do
|
66
|
+
env_init
|
67
|
+
|
68
|
+
with_rackup('redirecting.ru') do
|
69
|
+
tests("request not have content-length and body").returns('ok') do
|
70
|
+
Excon.post(
|
71
|
+
'http://127.0.0.1:9292',
|
72
|
+
:path => '/first',
|
73
|
+
:middlewares => Excon.defaults[:middlewares] + [Excon::Middleware::RedirectFollower],
|
74
|
+
:body => "a=Some_content"
|
75
|
+
).body
|
76
|
+
end
|
77
|
+
end
|
78
|
+
|
79
|
+
env_restore
|
80
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'sinatra'
|
2
|
+
require 'json'
|
3
|
+
require File.join(File.dirname(__FILE__), 'webrick_patch')
|
4
|
+
|
5
|
+
class App < Sinatra::Base
|
6
|
+
set :environment, :production
|
7
|
+
enable :dump_errors
|
8
|
+
|
9
|
+
post('/first') do
|
10
|
+
redirect "/second"
|
11
|
+
end
|
12
|
+
|
13
|
+
get('/second') do
|
14
|
+
post_body = request.body.read
|
15
|
+
if post_body == "" && request["CONTENT_LENGTH"].nil?
|
16
|
+
"ok"
|
17
|
+
else
|
18
|
+
JSON.pretty_generate(request.env)
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
run App
|
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.3
|
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-02-
|
13
|
+
date: 2015-02-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activesupport
|
@@ -221,6 +221,7 @@ files:
|
|
221
221
|
- tests/rackups/deflater.ru
|
222
222
|
- tests/rackups/proxy.ru
|
223
223
|
- tests/rackups/query_string.ru
|
224
|
+
- tests/rackups/redirecting.ru
|
224
225
|
- tests/rackups/request_headers.ru
|
225
226
|
- tests/rackups/request_methods.ru
|
226
227
|
- tests/rackups/response_header.ru
|