Bugfix for requests.exceptions.HTTPError: 502 Server Error: Bad Gateway