protocol-http1 0.11.0 → 0.11.1

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.

Potentially problematic release.


This version of protocol-http1 might be problematic. Click here for more details.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd207477ff1c6e86ccc2a90b3ec7ae27c7a3f5dbfd58e42cf78fb841638d43c1
4
- data.tar.gz: 797536146daeb57ce4b40cf4e71bbcea02cc49067ecdd05d1c1b9c55f768212d
3
+ metadata.gz: 1abaeacab084824635ae655081cf73fad89ff35597a3a8e8e2e0dc0ecd287903
4
+ data.tar.gz: a1b0f0f814c709a9e39cbceba69626853e5b64f5880d5ef4770e171d0c9730c9
5
5
  SHA512:
6
- metadata.gz: 0efd8f411bc383b88694116c674376acd8d9fd9871aa4d3a89bfa95a39b0124aa2577c1c3767a11eed91f310bb0581f07c8f80b20ab2a79033db534028b346ce
7
- data.tar.gz: 4e1836661c69a4dbe0cc42ac961afd76153e07f5a41f83428a8d37673924a05cbc9795daa1cc14f530bb38815cee374b61e2dbe105e6df21fafade35a103d6e2
6
+ metadata.gz: 655ebb21bf200f6ea36af2d34d02d6666ab85166f8d769b5a378dcaa9612a9c6738c9ee27856419745dfa96f2dd183bbef56c5ce72173c8f8258b0bd16da6262
7
+ data.tar.gz: d4e60fd12521536bf46dff62ef9097f88b47137ce476285484ff06229a9e9e67e7e19c9e42ee8b31522a187eea61eb27d9afe651ba0c9d6b045db43ee5d7081a
@@ -90,8 +90,6 @@ module Protocol
90
90
  end
91
91
 
92
92
  def read_trailers
93
- @headers.trailers!
94
-
95
93
  while line = read_line
96
94
  # Empty line indicates end of headers:
97
95
  break if line.empty?
@@ -357,12 +357,16 @@ module Protocol
357
357
  end
358
358
 
359
359
  def write_body(version, body, head = false, trailers = nil)
360
- if body.nil? or body.empty?
360
+ if body.nil?
361
361
  write_connection_header(version)
362
362
  write_empty_body(body)
363
- elsif length = body.length
363
+ elsif length = body.length and (VERSION != HTTP11 && trailers.nil?)
364
364
  write_connection_header(version)
365
365
  write_fixed_length_body(body, length, head)
366
+ elsif body.empty?
367
+ # Even thought this code is the same as the first clause `body.nil?`, HEAD responses have an empty body but still carry a content length. `write_fixed_length_body` takes care of this appropriately.
368
+ write_connection_header(version)
369
+ write_empty_body(body)
366
370
  elsif @persistent and version == HTTP11
367
371
  write_connection_header(version)
368
372
  # We specifically ensure that non-persistent connections do not use chunked response, so that hijacking works as expected.
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Protocol
24
24
  module HTTP1
25
- VERSION = "0.11.0"
25
+ VERSION = "0.11.1"
26
26
  end
27
27
  end
@@ -20,7 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_dependency "protocol-http", "~> 0.16.3"
23
+ spec.add_dependency "protocol-http", "~> 0.17"
24
24
 
25
25
  spec.add_development_dependency "covered"
26
26
  spec.add_development_dependency "bundler"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.11.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-06 00:00:00.000000000 Z
11
+ date: 2020-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: protocol-http
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.16.3
19
+ version: '0.17'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.16.3
26
+ version: '0.17'
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: covered
29
29
  requirement: !ruby/object:Gem::Requirement