responder
responder copied to clipboard
Simple test with api.requests take 20-30 seconds
Following the test instructions on https://python-responder.org/en/latest/testing.html#building-and-testing-with-responder, the test takes 20-30 seconds.
If you don't provide a domain name, Responder's version Requests makes the hostname ;
and then tries to resolve it. Since that's (hopefully!) not a real host, it fails to resolve and the developer has to wait for a timeout.
The problem is with the ;
here: https://github.com/taoufik07/responder/blob/master/responder/api.py#L317
One workaround is to explicitly overwrite the base_url
:
api.session().base_url = "http://example"
Since the session is reused for each instance of api
, this should work around the problem.