Skip to content

Commit

Permalink
Refactor use IO#read_byte instead of #read_char in `HTTP::Chunked…
Browse files Browse the repository at this point in the history
…Content` (#14548)
  • Loading branch information
straight-shoota committed May 1, 2024
1 parent 0f35ff7 commit 89f2e43
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/http/content.cr
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,11 @@ module HTTP
end

private def read_crlf
char = @io.read_char
if char == '\r'
char = @io.read_char
char = @io.read_byte
if char === '\r'
char = @io.read_byte
end
if char != '\n'
unless char === '\n'
raise IO::Error.new("Invalid HTTP chunked content: expected CRLF")
end
end
Expand Down

0 comments on commit 89f2e43

Please sign in to comment.