theelous3 / asks

Async requests-like httplib for python.
MIT License
508 stars 63 forks source link

Do not fail if a connection header is missing. #61

Closed miracle2k closed 6 years ago

miracle2k commented 6 years ago

When writing a point to InfluxDB, I receive the following headers back:

{'encoding': 'utf-8', 'method': 'POST', 'status_code': 204, 'reason_phrase': 'No Content', 'http_version': '1.1', 'headers': {'content-type': 'application/json', 'request-id': '33f73462-2d31-11e8-8012-000000000000', 'x-influxdb-build': 'OSS', 'x-influxdb-version': 'v1.4.3', 'x-request-id': '33f73462-2d31-11e8-8012-000000000000', 'date': 'Wed, 21 Mar 2018 17:56:38 GMT'}, 'body': b'', 'url': 'http://localhost:8086/write?db=testdb'}

asks fails here, and raises a KeyError when it tries to access headers['connection'].