Skip to content

fix: Remove Content-Encoding=Identity as the header as it violates the RFC #595

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jul 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ This release introduces a support for new version of InfluxDB API definitions wi
### Bug Fixes
1. [#583](https://github.com/influxdata/influxdb-client-python/pull/583): Async HTTP client doesn't always use `HTTP_PROXY`/`HTTPS_PROXY` environment variables. [async/await]
1. [#584](https://github.com/influxdata/influxdb-client-python/pull/584): Parsing empty query result value as `numpy.NaN`
1. [#595](https://github.com/influxdata/influxdb-client-python/pull/595): The `Config-Encoding: identity` header will no longer be set by the `write_api` calls to a remote server

## 1.36.1 [2023-02-23]

Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/client/write_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@ def _retry_callback_delegate(exception):
def _post_write(self, _async_req, bucket, org, body, precision, **kwargs):

return self._write_service.post_write(org=org, bucket=bucket, body=body, precision=precision,
async_req=_async_req, content_encoding="identity",
async_req=_async_req,
content_type="text/plain; charset=utf-8",
**kwargs)

Expand Down
2 changes: 1 addition & 1 deletion influxdb_client/client/write_api_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,6 @@ async def write(self, bucket: str, org: str = None,
body = b'\n'.join(payloads[write_precision])
response = await self._write_service.post_write_async(org=org, bucket=bucket, body=body,
precision=write_precision, async_req=False,
content_encoding="identity", _return_http_data_only=False,
_return_http_data_only=False,
content_type="text/plain; charset=utf-8")
return response[1] == 204
1 change: 0 additions & 1 deletion tests/test_gzip.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ def test_gzip_disabled(self):
self.assertEqual("identity", _requests[0].headers['Accept-Encoding'])
# Write
self.assertEqual("/api/v2/write?org=my-org&bucket=my-bucket&precision=ns", _requests[1].path)
self.assertEqual("identity", _requests[1].headers['Content-Encoding'])
self.assertEqual("identity", _requests[1].headers['Accept-Encoding'])
self.assertEqual("h2o_feet,location=coyote_creek water_level=1 1", _requests[1].parsed_body)
# Query
Expand Down