Skip to content

Commit 4b08074

Browse files
committed
Protocol::HTTP1::BadRequest includes Protocol::HTTP::BadRequeast.
1 parent 4b8a0c2 commit 4b08074

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

lib/protocol/http1/error.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ class LineLengthError < Error
2121

2222
# The request was not able to be parsed correctly, or failed some kind of validation.
2323
class BadRequest < Error
24+
include Protocol::HTTP::BadRequest
2425
end
2526

2627
# A header name or value was invalid, e.g. contains invalid characters.

releases.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Releases
22

3+
## Unreleased
4+
5+
- `Protocol::HTTP1::BadRequest` now includes `Protocol::HTTP::BadRequest` for better interoperability and handling of bad request errors across different HTTP protocol implementations.
6+
37
## v0.36.0
48

59
- Indicate trailers from chunked body for better validation by `Protocol::HTTP::Headers`.

test/protocol/http1/error.rb

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# Released under the MIT License.
4+
# Copyright, 2026, by Samuel Williams.
5+
6+
describe Protocol::HTTP1::BadRequest do
7+
it "should be a subclass of Protocol::HTTP::BadRequest" do
8+
expect(Protocol::HTTP1::BadRequest).to be < Protocol::HTTP::BadRequest
9+
end
10+
end

0 commit comments

Comments
 (0)