http 0.8.12 → 0.8.13

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2bb012bd8ce0fdf45a88171c20552f819279e316
4
- data.tar.gz: 094be455227c7e42aba8157819b9336b9744b9d1
3
+ metadata.gz: c377300d1381925e494d179d86be2c8c58d6713a
4
+ data.tar.gz: eeed70bcd44a8c11b164da27f0de196a77a9a5db
5
5
  SHA512:
6
- metadata.gz: 60ce4064cdafe70513e1749ace44afed30c9c08251d3d9ec0d0c1f205d243704403ca8643e96d7792fb23085e4ae755ab04db073c084142f7652f0ef5a594bdf
7
- data.tar.gz: a7c7acda4cb5c67cb84ee300d42f5871a413066a78c44188fb8d51de96047124ba4b25ece259b0785c7a806f16e0d7bdc911572d7d6ab292cfd52b1afb4d612c
6
+ metadata.gz: b9b9287f6db01ead5a849cb7bfec0a75d9de5de808c8c7f86bcfdd0940d895639b6786f694d533b2d30ed50e2af943093c5fa8102cd4547a7f17e2912f030cbe
7
+ data.tar.gz: 2db3d208ee7f88366b9118473257574ae413576820fdef9b780566caeb77598512754e64960a58bb7e6533dad66018fe283c224cd1ed3b88cddb9f93b100cd89
data/CHANGES.md CHANGED
@@ -1,3 +1,8 @@
1
+ ## 0.8.13 (2015-08-14)
2
+
3
+ * Backport params special-chars escaping fix from `v0.9.1`. (@ixti)
4
+
5
+
1
6
  ## 0.8.12 (2015-05-26)
2
7
 
3
8
  * Fix `HTTP.timeout` API (was loosing previously defined options). (@ixti)
data/Gemfile CHANGED
@@ -25,9 +25,9 @@ group :test do
25
25
  gem "json", ">= 1.8.1"
26
26
  gem "mime-types", "~> 1.25", :platforms => [:jruby]
27
27
  gem "rest-client", "~> 1.6.0", :platforms => [:jruby]
28
- gem "rspec", "~> 3.0"
28
+ gem "rspec", "~> 3.2.0"
29
29
  gem "rspec-its"
30
- gem "rubocop"
30
+ gem "rubocop", "~> 0.31.0"
31
31
  gem "yardstick"
32
32
  gem "certificate_authority"
33
33
  end
@@ -1,8 +1,5 @@
1
1
  require "forwardable"
2
2
 
3
- require "cgi"
4
- require "uri"
5
-
6
3
  require "http/form_data"
7
4
  require "http/options"
8
5
  require "http/headers"
@@ -115,7 +112,7 @@ module HTTP
115
112
  #
116
113
  # @param [#to_s] uri
117
114
  # @return [URI]
118
- def make_request_uri(uri, options)
115
+ def make_request_uri(uri, opts)
119
116
  uri = uri.to_s
120
117
 
121
118
  if default_options.persistent? && uri !~ HTTP_OR_HTTPS_RE
@@ -124,9 +121,8 @@ module HTTP
124
121
 
125
122
  uri = HTTP::URI.parse uri
126
123
 
127
- if options.params && !options.params.empty?
128
- params = CGI.parse(uri.query.to_s).merge(options.params || {})
129
- uri.query = ::URI.encode_www_form params
124
+ if opts.params && !opts.params.empty?
125
+ uri.query = [uri.query, HTTP::URI.form_encode(opts.params)].compact.join("&")
130
126
  end
131
127
 
132
128
  # Some proxies (seen on WEBRick) fail if URL has
@@ -1,3 +1,3 @@
1
1
  module HTTP
2
- VERSION = "0.8.12".freeze
2
+ VERSION = "0.8.13".freeze
3
3
  end
@@ -160,6 +160,14 @@ RSpec.describe HTTP::Client do
160
160
 
161
161
  client.get("http://example.com/?a[]=b&a[]=c", :params => {:d => "e"})
162
162
  end
163
+
164
+ it "properly encodes colons" do
165
+ expect(HTTP::Request).to receive(:new) do |_, uri|
166
+ expect(uri.query).to eq "t=1970-01-01T00%3A00%3A00Z"
167
+ end
168
+
169
+ client.get("http://example.com/", :params => {:t => "1970-01-01T00:00:00Z"})
170
+ end
163
171
  end
164
172
 
165
173
  describe "passing json" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.12
4
+ version: 0.8.13
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tony Arcieri
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2015-05-26 00:00:00.000000000 Z
14
+ date: 2015-08-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: http_parser.rb