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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e4440bcb5b85175c1a67c0ea114d9cb05b7c6cd4
4
- data.tar.gz: d0abeae0edd39addfb3ebc467376367acb08b60c
3
+ metadata.gz: 7bab65841deb9f42b9995536b43ba90f2304bd43
4
+ data.tar.gz: 4aa257ec3673a05e2e8016cc07a4125ae3ec3a1e
5
5
  SHA512:
6
- metadata.gz: dcdddbfd539ac3604257cf089722a531a8092e9c2239901568be315891b99d971dbc63f056ce61699598f696ab9e493fcd96deac7bee16381b06637acb6174f8
7
- data.tar.gz: f6f0a10e3cb51eac7cd63a09d6331c692bd072756022e554e8c3f344f7a71bac63d6f1cc3209ecffa9a3ace6779d2f2d64b1706d798df93c576bf71dbdfe7ef0
6
+ metadata.gz: a1f36fccc8ef6fb09ff5d03cb58168fdb8c70bf40d859c3c83966b0fa8a075da12db7a78ae1f90f3e0df5a0e5a9217316fe5ff1c7039b3ba6f32db11dd1d7075
7
+ data.tar.gz: a350f3e660fbb4d8ee724bfca8e8b36107886f9e9127e0cf8418a0c104d1cde8a3c927f6f10d2c4d5983e81952de64c90779d34ca8462297c014832df0d88b04
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- excon (0.44.2)
4
+ excon (0.44.3)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,3 +1,9 @@
1
+ 0.44.3 02/24/2015
2
+ =================
3
+
4
+ don't pass body when following GET redirects
5
+ fix error rescue case to properly reference error object
6
+
1
7
  0.44.2 02/11/2015
2
8
  =================
3
9
 
@@ -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.2'
17
- s.date = '2015-02-11'
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
@@ -1,6 +1,6 @@
1
1
  module Excon
2
2
 
3
- VERSION = '0.44.2'
3
+ VERSION = '0.44.3'
4
4
 
5
5
  CR_NL = "\r\n"
6
6
 
@@ -17,7 +17,11 @@ module Excon
17
17
  params = datum.dup
18
18
  params.delete(:stack)
19
19
  params.delete(:connection)
20
- params[:method] = :get if [301, 302, 303].include? response[:status]
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')
@@ -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[#{e.class}] #{e.message}")
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.2
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-11 00:00:00.000000000 Z
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