While adding the test, the code to recover from an exhausted HTTP/1.1
connection proved not to be reliable, as it wasn't taking inflight
requests nor update-once keep-alive max requests counters into
account.
This has been fixed by implementing our own test dummy using
webrick.
* sending info on whether the session is in persistent mode to the
request;
* on parser, set keep-alive when persistent, at all times;
* when not persistent, set keep-alive on all requests til the last;
* on error recovery, when resetting to 1 request at a time, still keep
alive to all requests til the last;
* on next error recovery, set connection: close
header;
this was wrongly closing connections for HTTP/1.1 connections which
didn't send a "Connection" header; according to spec, the default is
"Keep-Alive", contrary to HTTP/1.0
This logic was extracted from the vanilla httpx build to a plugin to
make the gem "leaner", by removing "http_form_data" as a hard
dependency.
The multipart plugin still requires one to install it though, but if you
don't need to upload files, you don't have to install the gem anymore