Skip to content

Commit

Permalink
Fix compilation error with latest pony compiler
Browse files Browse the repository at this point in the history
A small bit of code no longer works after
ponylang/ponyc#4588 was merged.

This fix gets the library working again.
  • Loading branch information
SeanTAllen committed Jan 26, 2025
1 parent cfc51df commit 7e94f37
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions http/http_parser.pony
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,7 @@ class HTTPParser
let value2: String val = consume value

// Examine certain headers describing the encoding.
match key
| "content-length" => // Explicit body length.
if key.eq("content-length") then
_expected_length = value2.read_int[USize]()?._1
// On the receiving end, there is no difference
// between Oneshot and Stream transfers except how
Expand All @@ -265,23 +264,20 @@ class HTTPParser
OneshotTransfer
end
_payload.transfer_mode = _transfer_mode

| "transfer-encoding" => // Incremental body lengths.
elseif key.eq("transfer-encoding") then
try
value2.find("chunked")?
_transfer_mode = ChunkedTransfer
_payload.transfer_mode = _transfer_mode
else
_state = _ExpectError
end

| "host" =>
elseif key.eq("host") then
// TODO: set url host and service
None

| "authorization" => _setauth(value2)

end // match certain headers
elseif key.eq("authorization") then
_setauth(value2)
end

_payload(consume key) = value2

Expand Down

0 comments on commit 7e94f37

Please sign in to comment.