Skip to content

Commit 9ac25e6

Browse files
committed
Make BadRequest and BadHeader both InvalidRequest.
1 parent 8d0bd10 commit 9ac25e6

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/protocol/http1/error.rb

+8-9
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,20 @@ module HTTP1
1010
class Error < HTTP::Error
1111
end
1212

13-
class InvalidRequest < Error
14-
end
15-
16-
# The specified content length and the given content's length do not match.
17-
class ContentLengthError < Error
13+
# The request was not able to be parsed correctly, or failed some kind of validation.
14+
class BadRequest < Error
1815
end
1916

20-
# The request was parsed correctly, but was invalid for some other reason.
21-
class BadRequest < Error
17+
# A header name or value was invalid, e.g. contains invalid characters.
18+
class BadHeader < BadRequest
2219
end
2320

24-
class BadHeader < Error
21+
# Indicates that the request is invalid for some reason, e.g. syntax error, invalid headers, etc.
22+
class InvalidRequest < BadRequest
2523
end
2624

27-
class BadResponse < Error
25+
# The specified content length and the given content's length do not match.
26+
class ContentLengthError < Error
2827
end
2928
end
3029
end

0 commit comments

Comments
 (0)