excon 0.44.0 → 0.44.1

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: 90759d86297bebbce2b0374cb730466df92321ec
4
- data.tar.gz: 67e4b85deb2f2b52455b190fa4c3df120fb1c532
3
+ metadata.gz: 481bfd91390599d3d4e0dfc27838fddc748adbf3
4
+ data.tar.gz: 0a6a75c64591bcb78f4a763667913c0a89e4ae8c
5
5
  SHA512:
6
- metadata.gz: bda8264156cb7f3983aaac5cd8327254cc0f06a1ec9f1dc701271798cf06bfe2c207e14fb55bdd9b6deb96ce15843c0b2c6b0f7a5fbb66ead49a21d199b9f976
7
- data.tar.gz: 511d4b47dd504535f78a25c4a741fcaea3206ec466fe57c199c6ae8c4ee8d5111ca5a1f8a39cb3e80cfb6f25d7f226df74a2b748f4b2392e3ece823479e470e8
6
+ metadata.gz: e6584d40bdf128fb820816775fa9fffd5504facd85704e8dec3e41c98a209e5dc8ca918d1ad7fb4662ae0f83cb556cb4ab782742c208170d3d0e62fc68b66b6e
7
+ data.tar.gz: 1942bd6aca9b73b82eb8a9a9b00cefb6b438416eaf85b53d4985d407a6d5bedcbac55df0e655817ba1c5a34a83f3e62b538e6b48554f5185b1a482d16bd30fee
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- excon (0.44.0)
4
+ excon (0.44.1)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,3 +1,8 @@
1
+ 0.44.1 02/01/2015
2
+ =================
3
+
4
+ fix issue with frozen strings in user/pass
5
+
1
6
  0.44.0 01/30/2015
2
7
  =================
3
8
 
@@ -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.0'
17
- s.date = '2015-01-30'
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
@@ -1,6 +1,6 @@
1
1
  module Excon
2
2
 
3
- VERSION = '0.44.0'
3
+ VERSION = '0.44.1'
4
4
 
5
5
  CR_NL = "\r\n"
6
6
 
@@ -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 }
@@ -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
- tests('Excon basics (Basic Auth Fail)') do
94
- cases = [
95
- ['correct user, no password', 'http://test_user@127.0.0.1:9292'],
96
- ['correct user, wrong password', 'http://test_user:fake_password@127.0.0.1:9292'],
97
- ['wrong user, correct password', 'http://fake_user:test_password@127.0.0.1:9292'],
98
- ]
99
- cases.each do |desc,url|
100
- tests("response.status for #{desc}").returns(401) do
101
- connection = Excon.new(url)
102
- response = connection.request(:method => :get, :path => '/content-length/100')
103
- response.status
104
- end
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.0
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-01-30 00:00:00.000000000 Z
13
+ date: 2015-02-02 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport