Skip to content

Commit

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

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

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

# The request was parsed correctly, but was invalid for some other reason.
class BadRequest < Error
class BadRequest < InvalidRequest
end

class BadHeader < Error
class BadHeader < InvalidRequest
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 d74b5d7

Please sign in to comment.