protocol-http1 0.14.1 → 0.14.4

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: 884c811e792417717ddccec3f8369607dcc46ede6951557c567a08b3fa7d434e
4
- data.tar.gz: 262f7ef658565c295964266c1eef6ff78464d39f7b7fa40bee7f44032d839570
3
+ metadata.gz: 366333c95d6b5a02d91e6f87c0274fddbe09a8c858bcb3e1cd54dfd5198794a6
4
+ data.tar.gz: 99db7c604bcd4a24ff8a96a7eb8aa7096b0f5f517849569780ff3b12aac58026
5
5
  SHA512:
6
- metadata.gz: 6c991118f30f922938caa5a83f05d91f9f627c0fb5cdf6525aa08e7c559340514b571c636ae7e4048b951848fc2f4d481388901cfd6b3b42c0d0312aa00a51bf
7
- data.tar.gz: 5f2e2cdb7b248fc83bd73d43b1e39102bd96663185994758b09d512adafabd59368e344ed38f472170bbac960a9d2386ad9d9e32ec01bb1fb05d0107f5bf509e
6
+ metadata.gz: cf0f094e6bf752d20115320c94c1796a56f835f524412ea3c9e51324be1802f517f8585838ee0fb7733529cac33adcc0d557d3ac255ab85fbdbdbf13686f00c1
7
+ data.tar.gz: 2c64561ec15d5842047d92311ef7130562ccca0f2302d79e2dcb5c52b85bbe7617235cd22a33cdd10d2b96c0ec2e0faa50c4514b1d48cc674702b7ed3febc5e4
checksums.yaml.gz.sig ADDED
Binary file
@@ -334,7 +334,7 @@ module Protocol
334
334
  @stream.flush unless body.ready?
335
335
  end
336
336
 
337
- if trailer
337
+ if trailer&.any?
338
338
  @stream.write("0\r\n")
339
339
  write_headers(trailer)
340
340
  @stream.write("\r\n")
@@ -366,17 +366,26 @@ module Protocol
366
366
  end
367
367
 
368
368
  def write_body(version, body, head = false, trailer = nil)
369
+ # HTTP/1.0 cannot in any case handle trailers.
370
+ if version == HTTP10 # or te: trailers was not present (strictly speaking not required.)
371
+ trailer = nil
372
+ end
373
+
374
+ # While writing the body, we don't know if trailers will be added. We must choose a different body format depending on whether there is the chance of trailers, even if trailer.any? is currently false.
375
+ #
376
+ # Below you notice `and trailer.nil?`. I tried this but content-length is more important than trailers.
377
+
369
378
  if body.nil?
370
379
  write_connection_header(version)
371
380
  write_empty_body(body)
372
- elsif length = body.length and trailer.nil?
381
+ elsif length = body.length # and trailer.nil?
373
382
  write_connection_header(version)
374
383
  write_fixed_length_body(body, length, head)
375
384
  elsif body.empty?
376
385
  # 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.
377
386
  write_connection_header(version)
378
387
  write_empty_body(body)
379
- elsif @persistent and version == HTTP11
388
+ elsif version == HTTP11
380
389
  write_connection_header(version)
381
390
  # We specifically ensure that non-persistent connections do not use chunked response, so that hijacking works as expected.
382
391
  write_chunked_body(body, head, trailer)
@@ -22,6 +22,6 @@
22
22
 
23
23
  module Protocol
24
24
  module HTTP1
25
- VERSION = "0.14.1"
25
+ VERSION = "0.14.4"
26
26
  end
27
27
  end
data.tar.gz.sig ADDED
Binary file
metadata CHANGED
@@ -1,14 +1,45 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.14.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
+ - Brian Morearty
9
+ - Bruno Sutic
10
+ - Olle Jonsson
8
11
  autorequire:
9
12
  bindir: bin
10
- cert_chain: []
11
- date: 2021-05-08 00:00:00.000000000 Z
13
+ cert_chain:
14
+ - |
15
+ -----BEGIN CERTIFICATE-----
16
+ MIIEhDCCAuygAwIBAgIBATANBgkqhkiG9w0BAQsFADA3MTUwMwYDVQQDDCxzYW11
17
+ ZWwud2lsbGlhbXMvREM9b3Jpb250cmFuc2Zlci9EQz1jby9EQz1uejAeFw0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v6g4VWO5ZU7z2JmPoTXZtYMunRAmQPFL/gSUc6aK
34
+ vszMHIyhtyzRc6DnfW2AiVOjMBjaYv8xXZc9bduniRVPrLR4J7ozmGLh4o4uJp7w
35
+ x9KCFaR8Lvn/r0oJWJOqb/DMAYI83YeN2Dlt3jpwrsmsONrtC5S3gOUle5afSGos
36
+ bYt5ocnEpKSomR9ZtnCGljds/aeO1Xgpn2r9HHcjwnH346iNrnHmMlC7BtHUFPDg
37
+ Ts92S47PTOXzwPBDsrFiq3VLbRjHSwf8rpqybQBH9MfzxGGxTaETQYOd6b4e4Ag6
38
+ y92abGna0bmIEb4+Tx9rQ10Uijh1POzvr/VTH4bbIPy9FbKrRsIQ24qDbNJRtOpE
39
+ RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
40
+ HiLJ8VOFx6w=
41
+ -----END CERTIFICATE-----
42
+ date: 2022-05-01 00:00:00.000000000 Z
12
43
  dependencies:
13
44
  - !ruby/object:Gem::Dependency
14
45
  name: protocol-http
@@ -127,7 +158,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
127
158
  - !ruby/object:Gem::Version
128
159
  version: '0'
129
160
  requirements: []
130
- rubygems_version: 3.2.3
161
+ rubygems_version: 3.1.6
131
162
  signing_key:
132
163
  specification_version: 4
133
164
  summary: A low level implementation of the HTTP/1 protocol.
metadata.gz.sig ADDED
Binary file