Skip to content

Commit

Permalink
Make BadHeader and InvalidRequest a subclass of BadRequest.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 26, 2024
1 parent 8d0bd10 commit 3724dff
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/protocol/http1/error.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,20 @@ module HTTP1
class Error < HTTP::Error
end

class InvalidRequest < Error
end

# The specified content length and the given content's length do not match.
class ContentLengthError < Error
# The request was not able to be parsed correctly, or failed some kind of validation.
class BadRequest < Error
end

# The request was parsed correctly, but was invalid for some other reason.
class BadRequest < Error
# A header name or value was invalid, e.g. contains invalid characters.
class BadHeader < BadRequest
end

class BadHeader < Error
# Indicates that the request is invalid for some reason, e.g. syntax error, invalid headers, etc.
class InvalidRequest < BadRequest
end

class BadResponse < Error
# The specified content length and the given content's length do not match.
class ContentLengthError < Error
end
end
end

0 comments on commit 3724dff

Please sign in to comment.