httparty 0.17.3 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of httparty might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 85f5f4bb0960433348095eae8acb0b225633c8ff3c7feaa0b40049200dfc0c20
4
- data.tar.gz: 8eb65aee38c9e7b0d3652ef420b10c53b600be16696960e271f4cd0f0fa1566b
2
+ SHA1:
3
+ metadata.gz: 4ea88350f8b4511a4253ac20a607de4fe8d18024
4
+ data.tar.gz: 4da05068909376452ac6274df706c94eba694318
5
5
  SHA512:
6
- metadata.gz: ad2f36dbbe08553ba810315e7bebe45a1d97af8f3de987d1839895fc974fe96a6a0765e0bdc0451af1379e67922e6b82df119e08b8bd0a7c956933ce388a3b64
7
- data.tar.gz: a2df829fcf5ee3d115de2657ccc4a70f16d97705a5a94013e22aa4d150cb3605d3afeabda6a2cd7cec3ebe7c0ff7546476b8af5de4b59383d591e9120baada82
6
+ metadata.gz: 9938bf2e1fec14dbd7a260ae098a90f0c1fa07417bac2156f56fa7569ec0d3fd179c18c2fa2f720cc65086950ce7fd5fd84c07589e7a1e589843cffbafe1b6f3
7
+ data.tar.gz: 85138c252a9adf15f4a9f929898296834a57b40f80476b5659f5644a6d9af2ae4ad46c005b625795e25aa562e5c02619a3cb19818bc13f23c5984f9be8f79663
@@ -1,3 +1,8 @@
1
+ ## 0.18.0
2
+
3
+ * [Support gzip/deflate transfer encoding when explicit headers are set](https://github.com/jnunemaker/httparty/pull/678).
4
+ * [Support edge case cookie format with a blank attribute](https://github.com/jnunemaker/httparty/pull/685).
5
+
1
6
  ## 0.17.3
2
7
 
3
8
  0.17.2 is broken https://github.com/jnunemaker/httparty/issues/681
@@ -41,11 +41,11 @@ module HTTParty
41
41
  # [:+limit+:] Maximum number of redirects to follow. Takes precedences over :+no_follow+.
42
42
  # [:+query+:] Query string, or an object that responds to #to_hash representing it. Normalized according to the same rules as :+body+. If you specify this on a POST, you must use an object which responds to #to_hash. See also HTTParty::ClassMethods.default_params.
43
43
  # [:+timeout+:] Timeout for opening connection and reading data.
44
- # [:+local_host:] Local address to bind to before connecting.
45
- # [:+local_port:] Local port to bind to before connecting.
46
- # [:+body_stream:] Allow streaming to a REST server to specify a body_stream.
47
- # [:+stream_body:] Allow for streaming large files without loading them into memory.
48
- # [:+multipart:] Force content-type to be multipart
44
+ # [:+local_host+:] Local address to bind to before connecting.
45
+ # [:+local_port+:] Local port to bind to before connecting.
46
+ # [:+body_stream+:] Allow streaming to a REST server to specify a body_stream.
47
+ # [:+stream_body+:] Allow for streaming large files without loading them into memory.
48
+ # [:+multipart+:] Force content-type to be multipart
49
49
  #
50
50
  # There are also another set of options with names corresponding to various class methods. The methods in question are those that let you set a class-wide default, and the options override the defaults on a request-by-request basis. Those options are:
51
51
  # * :+base_uri+: see HTTParty::ClassMethods.base_uri.
@@ -1,5 +1,5 @@
1
1
  class HTTParty::CookieHash < Hash #:nodoc:
2
- CLIENT_COOKIES = %w(path expires domain path secure httponly)
2
+ CLIENT_COOKIES = %w(path expires domain path secure httponly samesite)
3
3
 
4
4
  def add_cookies(value)
5
5
  case value
@@ -8,7 +8,7 @@ class HTTParty::CookieHash < Hash #:nodoc:
8
8
  when String
9
9
  value.split('; ').each do |cookie|
10
10
  array = cookie.split('=', 2)
11
- self[array[0].to_sym] = array[1]
11
+ self[array[0].to_sym] = array[1] if array[0]
12
12
  end
13
13
  else
14
14
  raise "add_cookies only takes a Hash or a String"
@@ -204,22 +204,15 @@ module HTTParty
204
204
  end
205
205
 
206
206
  def setup_raw_request
207
- @raw_request = http_method.new(request_uri(uri))
208
- @raw_request.body_stream = options[:body_stream] if options[:body_stream]
209
-
210
207
  if options[:headers].respond_to?(:to_hash)
211
208
  headers_hash = options[:headers].to_hash
212
-
213
- @raw_request.initialize_http_header(headers_hash)
214
- # If the caller specified a header of 'Accept-Encoding', assume they want to
215
- # deal with encoding of content. Disable the internal logic in Net:HTTP
216
- # that handles encoding, if the platform supports it.
217
- if @raw_request.respond_to?(:decode_content) && (headers_hash.key?('Accept-Encoding') || headers_hash.key?('accept-encoding'))
218
- # Using the '[]=' sets decode_content to false
219
- @raw_request['accept-encoding'] = @raw_request['accept-encoding']
220
- end
209
+ else
210
+ headers_hash = nil
221
211
  end
222
212
 
213
+ @raw_request = http_method.new(request_uri(uri), headers_hash)
214
+ @raw_request.body_stream = options[:body_stream] if options[:body_stream]
215
+
223
216
  if options[:body]
224
217
  body = Body.new(
225
218
  options[:body],
@@ -1,3 +1,3 @@
1
1
  module HTTParty
2
- VERSION = "0.17.3"
2
+ VERSION = "0.18.0"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httparty
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.3
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Nunemaker
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2019-12-16 00:00:00.000000000 Z
12
+ date: 2020-02-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: multi_xml
@@ -130,7 +130,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
130
130
  version: '0'
131
131
  requirements: []
132
132
  rubyforge_project:
133
- rubygems_version: 2.7.6
133
+ rubygems_version: 2.6.14
134
134
  signing_key:
135
135
  specification_version: 4
136
136
  summary: Makes http fun! Also, makes consuming restful web services dead easy.