Skip to content

Commit 141e084

Browse files
committed
docs: update CHANGELOG.md
1 parent f4ef1d5 commit 141e084

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@
77

88
### Features
99
1. [#272](https://github.com/influxdata/influxdb-client-java/pull/272): Add `PingService` to check status of OSS and Cloud instance
10-
2. [#278](https://github.com/influxdata/influxdb-client-java/pull/278): Add query method with all params for BucketsApi, OrganizationApi and TasksApi
10+
1. [#278](https://github.com/influxdata/influxdb-client-java/pull/278): Add query method with all params for BucketsApi, OrganizationApi and TasksApi
11+
12+
### Bug Fixes
13+
1. [#279](https://github.com/influxdata/influxdb-client-java/pull/279): Session authentication for InfluxDB `2.1`
1114

1215
### CI
1316
1. [#275](https://github.com/influxdata/influxdb-client-java/pull/275): Deploy `influxdb-client-test` package into Maven repository

client/src/main/java/com/influxdb/client/internal/AuthenticateInterceptor.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -147,16 +147,18 @@ void signout() throws IOException {
147147
return;
148148
}
149149

150-
Request authRequest = new Request.Builder()
150+
Request.Builder authRequest = new Request.Builder()
151151
.url(buildPath("api/v2/signout"))
152-
.post(RequestBody.create("application/json", null))
153-
.header("Cookie", string(sessionCookies))
154-
.build();
152+
.post(RequestBody.create("application/json", null));
155153

156-
this.signout.set(true);
157-
this.sessionCookies = null;
154+
if (sessionCookies != null) {
155+
authRequest.addHeader("Cookie", string(sessionCookies));
156+
}
157+
158+
signout.set(true);
159+
sessionCookies = null;
158160

159-
Response response = this.okHttpClient.newCall(authRequest).execute();
161+
Response response = okHttpClient.newCall(authRequest.build()).execute();
160162
response.close();
161163
}
162164

client/src/test/java/com/influxdb/client/internal/AuthenticateInterceptorTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ void authorizationSession() throws IOException, InterruptedException {
117117
RecordedRequest requestToTasks = mockServer.takeRequest();
118118
Assertions.assertThat(requestToTasks.getPath()).endsWith("/api/v2/tasks");
119119
Assertions.assertThat(requestToTasks.getHeader("Cookie"))
120-
.isEqualTo("session=yCgXaEBF8mYSmJUweRcW0g_5jElMs7mv6_-G1bNcau4Z0ZLQYtj0BkHZYRnBVA6uXHtyuhflcOzyNDNRxnaC0A==");
120+
.isEqualTo("session=yCgXaEBF8mYSmJUweRcW0g_5jElMs7mv6_-G1bNcau4Z0ZLQYtj0BkHZYRnBVA6uXHtyuhflcOzyNDNRxnaC0A==; path=/api/v2");
121121
}
122122

123123
@Test

0 commit comments

Comments
 (0)