Skip to content

Commit

Permalink
[nest] Fix possible memory leak and communication problems (openhab#7871
Browse files Browse the repository at this point in the history
)

It is possible the NestStreamingRequestFilter adds multiple of the same headers which may result in a memory leak and communication problems.

This is the same fix as added in openhab#7811 for OH3 with CXF.

Signed-off-by: Wouter Born <[email protected]>
  • Loading branch information
wborn authored and andrewfg committed Aug 31, 2020
1 parent 175ceec commit db4fe39
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ public NestStreamingRequestFilter(String accessToken) {
public void filter(@Nullable ClientRequestContext requestContext) throws IOException {
if (requestContext != null) {
MultivaluedMap<String, Object> headers = requestContext.getHeaders();
headers.add(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
headers.add(HttpHeaders.CACHE_CONTROL, "no-cache");
headers.putSingle(HttpHeaders.AUTHORIZATION, "Bearer " + accessToken);
headers.putSingle(HttpHeaders.CACHE_CONTROL, "no-cache");
}
}
}

0 comments on commit db4fe39

Please sign in to comment.