HTML supports adding a ping attribute to <a> tags. In such cases, the browser sents a POST request to the set URL(s) before navigating to the new URL (See w3schools doc here and Mozilla docs on initiatorType which includes ping as an option).
Unfortunately, because these requests do not receive a server response Ferrum adds them to the list of pending_connections, meaning that subsequent calls to wait_for_idle will timeout waiting for these never-will-complete requests.
Changes
Add Request#response_expected? method to indicate if the request expects a response from the server (currently 'ping' is the only request I know of that would not get a response)
Add Exchange#response_expected? that calls the request method. Note, if request.nil? we default to true to match the current behaviour
Update Exchange#finished? so that any requests that do not expect responses are now also considered 'finished'
Motivation
HTML supports adding a
ping
attribute to<a>
tags. In such cases, the browser sents a POST request to the set URL(s) before navigating to the new URL (See w3schools doc here and Mozilla docs on initiatorType which includesping
as an option). Unfortunately, because these requests do not receive a server response Ferrum adds them to the list ofpending_connections
, meaning that subsequent calls towait_for_idle
will timeout waiting for these never-will-complete requests.Changes
Request#response_expected?
method to indicate if the request expects a response from the server (currently 'ping' is the only request I know of that would not get a response)Exchange#response_expected?
that calls the request method. Note, ifrequest.nil?
we default totrue
to match the current behaviourExchange#finished?
so that any requests that do not expect responses are now also considered 'finished'