Skip to content

Commit

Permalink
Change .dump to .inspect. Fixes #34.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Aug 31, 2024
1 parent 9cfcbd7 commit 7863730
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions lib/protocol/http1/body/chunked.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def read
length, _extensions = read_line.split(";", 2)

unless length =~ VALID_CHUNK_LENGTH
raise BadRequest, "Invalid chunk length: #{length.dump}"
raise BadRequest, "Invalid chunk length: #{length.inspect}"
end

# It is possible this line contains chunk extension, so we use `to_i` to only consider the initial integral part:
Expand Down Expand Up @@ -93,7 +93,7 @@ def read_trailer
if match = line.match(HEADER)
@headers.add(match[1], match[2])
else
raise BadHeader, "Could not parse header: #{line.dump}"
raise BadHeader, "Could not parse header: #{line.inspect}"
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/protocol/http1/connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ def read_headers
if match = line.match(HEADER)
fields << [match[1], match[2]]
else
raise BadHeader, "Could not parse header: #{line.dump}"
raise BadHeader, "Could not parse header: #{line.inspect}"
end
end

Expand Down Expand Up @@ -445,7 +445,7 @@ def extract_content_length(headers)
if content_length =~ VALID_CONTENT_LENGTH
yield Integer(content_length, 10)
else
raise BadRequest, "Invalid content length: #{content_length.dump}"
raise BadRequest, "Invalid content length: #{content_length.inspect}"
end
end
end
Expand Down

0 comments on commit 7863730

Please sign in to comment.