Skip to content

Commit

Permalink
fix: 🐛 replace accept-encoding application/json to null on all clients
Browse files Browse the repository at this point in the history
- this header is not used for influx 2.0 server because it always send back CSV data
- this header blocks the accept-encoding gzip header from the BridgeInterceptor
  • Loading branch information
Antoine DAVID committed Mar 12, 2021
1 parent c6aaa57 commit efa46cf
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 9 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## 2.1.0 [unreleased]

### Bug Fixes
1. [#205](https://github.com/influxdata/influxdb-client-java/pull/205): Fix GZIP issue for query executed from all clients [see issue comments](https://github.com/influxdata/influxdb-client-java/issues/50#issuecomment-796896401)

## 2.0.0 [2021-03-05]

### API
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ internal class QueryKotlinApiImpl(private val service: QueryService, private val

val channel = Channel<String>()

val queryCall = service.postQueryResponseBody(null, "application/json",
val queryCall = service.postQueryResponseBody(null, null,
null, org, null, query)

val consumer = BiConsumer { cancellable: Cancellable, line: String ->
Expand All @@ -194,7 +194,7 @@ internal class QueryKotlinApiImpl(private val service: QueryService, private val

val channel = Channel<T>()

val queryCall = service.postQueryResponseBody(null, "application/json",
val queryCall = service.postQueryResponseBody(null, null,
null, org, null, query)

val responseConsumer = object : FluxResponseConsumer {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public Flowable<FluxRecord> query(@Nonnull final Publisher<String> queryStream,

return Flowable
.fromPublisher(queryStream)
.map(it -> service.postQueryResponseBody(null, "application/json",
.map(it -> service.postQueryResponseBody(null, null,
null, org, null, new Query().query(it).dialect(AbstractInfluxDBClient.DEFAULT_DIALECT)))
.flatMap(queryCall -> {

Expand Down Expand Up @@ -256,7 +256,7 @@ public Flowable<String> queryRaw(@Nonnull final Publisher<String> queryStream,

return Flowable
.fromPublisher(queryStream)
.map(it -> service.postQueryResponseBody(null, "application/json",
.map(it -> service.postQueryResponseBody(null, null,
null, org, null, new Query().query(it).dialect(dialect)))
.flatMap(queryCall -> {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ class QueryScalaApiImpl(@Nonnull service: QueryService, @Nonnull options: Influx

Source.unfoldResource[FluxRecord, AbstractQueryApi#FluxRecordIterator](
() => {
val call = service.postQueryResponseBody(null, "application/json", null, org, null, query)
val call = service.postQueryResponseBody(null, null, null, org, null, query)

queryIterator(call)

Expand Down Expand Up @@ -277,7 +277,7 @@ class QueryScalaApiImpl(@Nonnull service: QueryService, @Nonnull options: Influx

Source.unfoldResource[String, AbstractQueryApi#RawIterator](
() => {
val call = service.postQueryResponseBody(null, "application/json", null, org, null, query)
val call = service.postQueryResponseBody(null, null, null, org, null, query)

queryRawIterator(call)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -793,8 +793,7 @@ private void query(@Nonnull final Query query,
@Nonnull final Boolean asynchronously) {

Call<ResponseBody> queryCall = service
.postQueryResponseBody(null, "application/json",
null, org, null, query);
.postQueryResponseBody(null, null, null, org, null, query);


LOG.log(Level.FINEST, "Prepare query \"{0}\" with dialect \"{1}\" on organization \"{2}\".",
Expand All @@ -811,7 +810,7 @@ private void queryRaw(@Nonnull final Query query,
@Nonnull final Boolean asynchronously) {

Call<ResponseBody> queryCall = service
.postQueryResponseBody(null, "application/json", null, org, null, query);
.postQueryResponseBody(null, null, null, org, null, query);

LOG.log(Level.FINEST, "Prepare raw query \"{0}\" with dialect \"{1}\" on organization \"{2}\".",
new Object[]{query, query.getDialect(), org});
Expand Down

0 comments on commit efa46cf

Please sign in to comment.