Newer versions of HTTP::Server::Simple more correctly implement RFC1616, which unfortunately does not leave it as a usable proxy because the <scheme>://<host>:<port> part of the request is entirely discarded when the request is parsed for HTTP/1.1 requests. I've hacked in an overidden parse_request() method in TestServer.pm which "is a" HTTP::Server::Simple::CGI, which restores the old behaviour of not complying with RFC1616.
This is the second half of the patch from Kari Pahula from Github: kaol@8e3c4d5 Supports adding a cookie_jar per request item or on the object as a whole. If set on the object as a whole the cookie jar is used for all requests which are sent and responses which are received.
Bug pointed out by Github user kloevschall here: #8 Test uses his example rather than implementing something in the local TestServer module, which means that it requires the REAL_SERVERS environment variable to be set to run.
This was requested by Ikegami in https://rt.cpan.org/Ticket/Display.html?id=77200 The logic is slightly complicated as it needs to remove the items from one of three state queues: "to_send", "in_progress" or "to_return". The tests for this are quite complicated as we needed to be certain of having items in specific states such as "to_return" and "in_progress".
This was requested by Dave Hodgkinson on rt.cpan.org https://rt.cpan.org/Public/Bug/Display.html?id=93619