Summary
The finished() method in both PaginatedJsonRequesterHandler and JsonRequesterHandler has a logic bug in the redirect status check:
elseif (_status != 301) or (_status != 307) then
_receiver.failure(_status, consume y, "")
end
This condition is always true. If _status is 301, then _status != 307 is true. If _status is 307, then _status != 301 is true. For any other status, both sides are true.
The fix is and:
elseif (_status != 301) and (_status != 307) then
Locations
github_rest_api/paginated_list.pony:236
github_rest_api/request/http_get.pony:108
Impact
Likely masked in practice because apply() returns early on redirect responses with OneshotTransfer before finished() fires. But if a redirect arrived via chunked transfer, a spurious failure would be reported to the receiver alongside the legitimate redirect request.
Summary
The
finished()method in bothPaginatedJsonRequesterHandlerandJsonRequesterHandlerhas a logic bug in the redirect status check:This condition is always true. If
_statusis 301, then_status != 307is true. If_statusis 307, then_status != 301is true. For any other status, both sides are true.The fix is
and:Locations
github_rest_api/paginated_list.pony:236github_rest_api/request/http_get.pony:108Impact
Likely masked in practice because
apply()returns early on redirect responses with OneshotTransfer beforefinished()fires. But if a redirect arrived via chunked transfer, a spurious failure would be reported to the receiver alongside the legitimate redirect request.