protocol-http1 0.29.0 → 0.31.0

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
  SHA256:
3
- metadata.gz: 9bb4702073bd3765421e3806d098c9d0e842f5a82497559ad242a282c4e67021
4
- data.tar.gz: db6a5b8da784a1ed7b0273a3986138b27c558db89b6477eb27645dcbd6d2e0fb
3
+ metadata.gz: 29db57e08ceb65831410a015b07b643fe3223c119327f001485c4d942195516e
4
+ data.tar.gz: 01b83de5925e1d89d4ffb729f22bab647e4fa5ac04d239a2ff81899bacb395f9
5
5
  SHA512:
6
- metadata.gz: 7cd9daa93a559f61419a767451733e75151a4e6ca38b28edd3241ef4ff33cee3878303ba7b5aca8d483016c3ca9b2fc48fdbf0a38be4b51c1b74cb511aaae569
7
- data.tar.gz: 8b546aed69866e812d10c334aa546298516deb30e5acd7b47cee76fe27cf772b866486aee3350580c76105789a582c0a413e508194ba0146a3fc0f5c8ecb25f9
6
+ metadata.gz: 564dcdb26845995de2c5f05b0b8e6c464615a6cc7345685c30e5d28bca09ccd03f3b58075da67e7afb3aab5ecb8213db76fb3fad1e59643899f68e0415ca915b
7
+ data.tar.gz: a10dbcdcf55d5687eb3e94476869b2ce4af1502a056e5f70b4dfb1c751ba2bf2bad46e11cd8d8ae666314390eec95daef1c39a5ad93debab744718fadd568535
checksums.yaml.gz.sig CHANGED
Binary file
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
  # Copyright, 2019, by Brian Morearty.
6
6
  # Copyright, 2020, by Bruno Sutic.
7
7
  # Copyright, 2023-2024, by Thomas Morgan.
@@ -148,7 +148,7 @@ module Protocol
148
148
  else
149
149
  return false
150
150
  end
151
- else
151
+ else # HTTP/1.1+
152
152
  if connection = headers[CONNECTION]
153
153
  return !connection.close?
154
154
  else
@@ -224,11 +224,11 @@ module Protocol
224
224
  return self
225
225
  end
226
226
 
227
- def write_request(authority, method, path, version, headers)
227
+ def write_request(authority, method, target, version, headers)
228
228
  open!
229
229
 
230
- @stream.write("#{method} #{path} #{version}\r\n")
231
- @stream.write("host: #{authority}\r\n")
230
+ @stream.write("#{method} #{target} #{version}\r\n")
231
+ @stream.write("host: #{authority}\r\n") if authority
232
232
 
233
233
  write_headers(headers)
234
234
  end
@@ -320,7 +320,11 @@ module Protocol
320
320
 
321
321
  headers = read_headers
322
322
 
323
- @persistent = persistent?(version, method, headers)
323
+ # If we are not persistent, we can't become persistent even if the request might allow it:
324
+ if @persistent
325
+ # In other words, `@persistent` can only transition from true to false.
326
+ @persistent = persistent?(version, method, headers)
327
+ end
324
328
 
325
329
  body = read_request_body(method, headers)
326
330
 
@@ -358,7 +362,9 @@ module Protocol
358
362
 
359
363
  headers = read_headers
360
364
 
361
- @persistent = persistent?(version, method, headers)
365
+ if @persistent
366
+ @persistent = persistent?(version, method, headers)
367
+ end
362
368
 
363
369
  unless interim_status?(status)
364
370
  body = read_response_body(method, status, headers)
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  # Released under the MIT License.
4
- # Copyright, 2019-2024, by Samuel Williams.
4
+ # Copyright, 2019-2025, by Samuel Williams.
5
5
 
6
6
  module Protocol
7
7
  module HTTP1
8
- VERSION = "0.29.0"
8
+ VERSION = "0.31.0"
9
9
  end
10
10
  end
data/license.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MIT License
2
2
 
3
- Copyright, 2019-2024, by Samuel Williams.
3
+ Copyright, 2019-2025, by Samuel Williams.
4
4
  Copyright, 2019, by Brian Morearty.
5
5
  Copyright, 2020, by Olle Jonsson.
6
6
  Copyright, 2020, by Bruno Sutic.
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: protocol-http1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.29.0
4
+ version: 0.31.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -41,7 +41,7 @@ cert_chain:
41
41
  Q2K9NVun/S785AP05vKkXZEFYxqG6EW012U4oLcFl5MySFajYXRYbuUpH6AY+HP8
42
42
  voD0MPg1DssDLKwXyt1eKD/+Fq0bFWhwVM/1XiAXL7lyYUyOq24KHgQ2Csg=
43
43
  -----END CERTIFICATE-----
44
- date: 2025-01-28 00:00:00.000000000 Z
44
+ date: 2025-03-13 00:00:00.000000000 Z
45
45
  dependencies:
46
46
  - !ruby/object:Gem::Dependency
47
47
  name: protocol-http
metadata.gz.sig CHANGED
Binary file