As redirect responses are sharing the same requestId and as that code is only selecting the last exchange response e.g. the final response, only that exchange response is marked as loaded?.
Proposed fix
Assigning loaded = true at the time that redirect response object is created.
Note: Unfortunately I'm running into issues executing tests locally so I didn't add any. Per my quick testing, it looks to be solving the aforementioned issue.
Issue
Fixes https://github.com/rubycdp/ferrum/issues/321
Context
Redirect
Ferrum::Network::Response
are created within theNetwork.requestWillBeSent
event:https://github.com/rubycdp/ferrum/blob/e2340b3458a74beece94e0156c4dea05f191259b/lib/ferrum/network.rb#L358-L366
Additionally, the
Network.loadingFinished
event is where responses are marked asloaded = true
: https://github.com/rubycdp/ferrum/blob/e2340b3458a74beece94e0156c4dea05f191259b/lib/ferrum/network.rb#L386-L392As redirect responses are sharing the same
requestId
and as that code is only selecting the last exchange response e.g. the final response, only that exchange response is marked asloaded?
.Proposed fix
Assigning
loaded = true
at the time that redirect response object is created.Note: Unfortunately I'm running into issues executing tests locally so I didn't add any. Per my quick testing, it looks to be solving the aforementioned issue.