protocol-http1 0.39.0 → 0.40.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: 0e973bb5fe97e0766eccc257775e2549397eb1fa8f308851e653987e90f05d66
4
- data.tar.gz: a688b1894c1eeb0dc5c0dd08eb40259b16e6e4b749d6d35939cd3468b5011393
3
+ metadata.gz: ab25a92df4b7a3a47fedfb27a10b76ef768fa1472b4e8e2af5f954671212ee02
4
+ data.tar.gz: 7f2c88ff5cd039ecd982e9129ee7b10441c42c65eaabd9cd70e1379e268aee29
5
5
  SHA512:
6
- metadata.gz: a2fb5ee2311c5536d3d3e75e609a7a577f69854dc5449a04755ac4a0efea07d042b5d0f13b4c42563ad1d762f1ffed421889ab29f1b3392bada9e0a03e314726
7
- data.tar.gz: d9ad14658632916da00953025fac66e6644be9e1e9504d5ad7e5a2bd74577c7ea21ce2073194ff2e9034e865172b609da3f03323d52ff4176f70957f44a2cb4c
6
+ metadata.gz: 34d8dbeb53722ca4128e5c0ce9dc228aa231b59987feeb26bb5dde04db942e662406a2a751a637cd98629d7da46099a9b1d5731bb9d5eb19f41179ae696ae8c3
7
+ data.tar.gz: 0a809c874a1a6143588025865f14681d839b6394c441731092d50cafc86bdd9ed0064890d51271015adce8bb701a1836d2c306bb9cdae8900e66b3d00809c4e6
checksums.yaml.gz.sig CHANGED
Binary file
@@ -8,8 +8,8 @@
8
8
  # Copyright, 2024, by Anton Zhuravsky.
9
9
 
10
10
  require "protocol/http/headers"
11
+ require "protocol/http/status"
11
12
 
12
- require_relative "reason"
13
13
  require_relative "error"
14
14
  require_relative "body"
15
15
 
@@ -277,7 +277,7 @@ module Protocol
277
277
  # @parameter headers [Hash] the HTTP headers.
278
278
  # @parameter reason [String] the reason phrase, defaults to the standard reason phrase for the status code.
279
279
  def write_response(version, status, headers, reason = nil)
280
- reason ||= Reason::DESCRIPTIONS[status]
280
+ reason ||= Protocol::HTTP::Status.description(status)
281
281
 
282
282
  unless @state == :open or @state == :half_closed_remote
283
283
  raise ProtocolError, "Cannot write response in state: #{@state}!"
@@ -297,7 +297,7 @@ module Protocol
297
297
  # @parameter reason [String] the reason phrase, defaults to the standard reason phrase for the status code.
298
298
  # @raises [ProtocolError] if the connection is not in the open or half-closed remote state.
299
299
  def write_interim_response(version, status, headers, reason = nil)
300
- reason ||= Reason::DESCRIPTIONS[status]
300
+ reason ||= Protocol::HTTP::Status.description(status)
301
301
 
302
302
  unless @state == :open or @state == :half_closed_remote
303
303
  raise ProtocolError, "Cannot write interim response in state: #{@state}!"
@@ -5,6 +5,6 @@
5
5
 
6
6
  module Protocol
7
7
  module HTTP1
8
- VERSION = "0.39.0"
8
+ VERSION = "0.40.0"
9
9
  end
10
10
  end
data/readme.md CHANGED
@@ -30,6 +30,10 @@ Please see the [project documentation](https://socketry.github.io/protocol-http1
30
30
 
31
31
  Please see the [project releases](https://socketry.github.io/protocol-http1/releases/index) for all releases.
32
32
 
33
+ ### v0.40.0
34
+
35
+ - Use `Protocol::HTTP::Status` for standard HTTP status descriptions and remove the duplicate `Protocol::HTTP1::Reason` table.
36
+
33
37
  ### v0.39.0
34
38
 
35
39
  - Rename `RequestRefusedError` -\> `RefusedError`.
@@ -68,10 +72,6 @@ Please see the [project releases](https://socketry.github.io/protocol-http1/rele
68
72
 
69
73
  - Support empty header values in HTTP parsing for better compatibility.
70
74
 
71
- ### v0.33.0
72
-
73
- - Support high-byte characters in HTTP headers for improved international compatibility.
74
-
75
75
  ## Contributing
76
76
 
77
77
  We welcome contributions to this project.
data/releases.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Releases
2
2
 
3
+ ## v0.40.0
4
+
5
+ - Use `Protocol::HTTP::Status` for standard HTTP status descriptions and remove the duplicate `Protocol::HTTP1::Reason` table.
6
+
3
7
  ## v0.39.0
4
8
 
5
9
  - Rename `RequestRefusedError` -\> `RefusedError`.
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.39.0
4
+ version: 0.40.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -49,14 +49,14 @@ dependencies:
49
49
  requirements:
50
50
  - - "~>"
51
51
  - !ruby/object:Gem::Version
52
- version: '0.62'
52
+ version: '0.68'
53
53
  type: :runtime
54
54
  prerelease: false
55
55
  version_requirements: !ruby/object:Gem::Requirement
56
56
  requirements:
57
57
  - - "~>"
58
58
  - !ruby/object:Gem::Version
59
- version: '0.62'
59
+ version: '0.68'
60
60
  executables: []
61
61
  extensions: []
62
62
  extra_rdoc_files: []
@@ -70,7 +70,6 @@ files:
70
70
  - lib/protocol/http1/body/remainder.rb
71
71
  - lib/protocol/http1/connection.rb
72
72
  - lib/protocol/http1/error.rb
73
- - lib/protocol/http1/reason.rb
74
73
  - lib/protocol/http1/version.rb
75
74
  - lib/traces/provider/protocol/http1.rb
76
75
  - lib/traces/provider/protocol/http1/connection.rb
@@ -97,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
97
96
  - !ruby/object:Gem::Version
98
97
  version: '0'
99
98
  requirements: []
100
- rubygems_version: 4.0.6
99
+ rubygems_version: 4.0.10
101
100
  specification_version: 4
102
101
  summary: A low level implementation of the HTTP/1 protocol.
103
102
  test_files: []
metadata.gz.sig CHANGED
Binary file
@@ -1,84 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Released under the MIT License.
4
- # Copyright, 2019-2025, by Samuel Williams.
5
-
6
- require "protocol/http/error"
7
-
8
- module Protocol
9
- module HTTP1
10
- # Reason phrases for HTTP status codes.
11
- module Reason
12
- # Get the reason phrase for the given status code.
13
- DESCRIPTIONS = {
14
- 100 => "Continue",
15
- 101 => "Switching Protocols",
16
- 102 => "Processing",
17
- 103 => "Early Hints",
18
-
19
- 200 => "OK",
20
- 201 => "Created",
21
- 202 => "Accepted",
22
- 203 => "Non-Authoritative Information",
23
- 204 => "No Content",
24
- 205 => "Reset Content",
25
- 206 => "Partial Content",
26
- 207 => "Multi-Status",
27
- 208 => "Already Reported",
28
- 226 => "IM Used",
29
-
30
- 300 => "Multiple Choices",
31
- 301 => "Moved Permanently",
32
- 302 => "Found",
33
- 303 => "See Other",
34
- 304 => "Not Modified",
35
- 305 => "Use Proxy",
36
-
37
- # no longer used, but included for completeness
38
- 306 => "Switch Proxy",
39
- 307 => "Temporary Redirect",
40
- 308 => "Permanent Redirect",
41
-
42
- 400 => "Bad Request",
43
- 401 => "Unauthorized",
44
- 402 => "Payment Required",
45
- 403 => "Forbidden",
46
- 404 => "Not Found",
47
- 405 => "Method Not Allowed",
48
- 406 => "Not Acceptable",
49
- 407 => "Proxy Authentication Required",
50
- 408 => "Request Timeout",
51
- 409 => "Conflict",
52
- 410 => "Gone",
53
- 411 => "Length Required",
54
- 412 => "Precondition Failed",
55
- 413 => "Payload Too Large",
56
- 414 => "URI Too Long",
57
- 415 => "Unsupported Media Type",
58
- 416 => "Range Not Satisfiable",
59
- 417 => "Expectation Failed",
60
- 421 => "Misdirected Request",
61
- 422 => "Unprocessable Entity",
62
- 423 => "Locked",
63
- 424 => "Failed Dependency",
64
- 426 => "Upgrade Required",
65
- 428 => "Precondition Required",
66
- 429 => "Too Many Requests",
67
- 431 => "Request Header Fields Too Large",
68
- 451 => "Unavailable for Legal Reasons",
69
-
70
- 500 => "Internal Server Error",
71
- 501 => "Not Implemented",
72
- 502 => "Bad Gateway",
73
- 503 => "Service Unavailable",
74
- 504 => "Gateway Timeout",
75
- 505 => "HTTP Version Not Supported",
76
- 506 => "Variant Also Negotiates",
77
- 507 => "Insufficient Storage",
78
- 508 => "Loop Detected",
79
- 510 => "Not Extended",
80
- 511 => "Network Authentication Required"
81
- }.freeze
82
- end
83
- end
84
- end