async-http 0.27.5 → 0.27.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ddfa60e94b8f9f1f6dd9223a44557a3e96094f966626ce42a6e54cc96da09fce
4
- data.tar.gz: 59e1b1640a8253f8386c5660a2ba3220fb7da9c677bfb670bd1188df19a4b841
3
+ metadata.gz: '04804a551a037e5843feb5bb4f90f1894adf06b9f962e82aba11922ff4e31fe8'
4
+ data.tar.gz: 43d4433a0f3ca5bc621e8af54d4679022abf89475016d08a12d7db878781c6f7
5
5
  SHA512:
6
- metadata.gz: 382bce6f93ecb3b5616e4e1bd9d166f2a6686f399d4c1ef8201472c90b2fc7e3ac20149f436e0f80ed5958a6f5cca3652692265ff70583d6e6d83942b4e4d679
7
- data.tar.gz: 8574436df8877c5d31b7a0a95f9151c2c4008ccf686c5d4615e701178eced150f033ae38166e13b9235527cba953146b571917cd5d776318bec25285a3fd3df4
6
+ metadata.gz: cf2278a356aeb0dadf8c3acec77ef21f50c91fdad4a43adcda743098cf68f550d460d7096b32d001898919520e58923bbb7ab5d3c428c838869fd0bd41bd4be3
7
+ data.tar.gz: c78ffd154a4b249ee068c7988c97446670c2d17e24470b4b9f95ceef83179ff590773950c9a69766e619717810d3f6d7b421e34eff1a0c6913ba4ac2876e0275
@@ -46,6 +46,10 @@ module Async
46
46
  # Early exit if the response has already specified a content-encoding.
47
47
  return response if response.headers['content-encoding']
48
48
 
49
+ # This is a very tricky issue, so we avoid it entirely.
50
+ # https://lists.w3.org/Archives/Public/ietf-http-wg/2014JanMar/1179.html
51
+ return response if response.partial?
52
+
49
53
  # TODO use http-accept and sort by priority
50
54
  if !response.body.empty? and accept_encoding = request.headers['accept-encoding']
51
55
  if content_type = response.headers['content-type'] and @content_types =~ content_type
@@ -48,6 +48,10 @@ module Async
48
48
  status >= 200 && status < 300
49
49
  end
50
50
 
51
+ def partial?
52
+ status == 206
53
+ end
54
+
51
55
  def redirection?
52
56
  status >= 300 && status < 400
53
57
  end
@@ -20,6 +20,6 @@
20
20
 
21
21
  module Async
22
22
  module HTTP
23
- VERSION = "0.27.5"
23
+ VERSION = "0.27.6"
24
24
  end
25
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: async-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.27.5
4
+ version: 0.27.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-04 00:00:00.000000000 Z
11
+ date: 2018-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async