Skip to content

Commit

Permalink
dont add auth token header if it is null
Browse files Browse the repository at this point in the history
  • Loading branch information
pschmidt88 committed May 12, 2020
1 parent d61a4cc commit 987c89c
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ public void proxyUserRequest(final String userId,
proxiedReq.headers().add(X_FORWARDED_PROTO, getHeader(origReq, X_FORWARDED_PROTO, origReq.scheme()));
proxiedReq.headers().add(X_FORWARDED_FOR, getHeader(origReq, X_FORWARDED_FOR, origReq.remoteAddress().host()));
proxiedReq.headers().addAll(origReq.headers());
proxiedReq.headers().add("X-Auth-Token", accessToken);
if (accessToken != null) {
proxiedReq.headers().add("X-Auth-Token", accessToken);
}
proxiedReq.headers().remove(HttpHeaders.CONTENT_LENGTH);
injectRutHeader(proxiedReq, userId);
origReq.handler(proxiedReq::write);
Expand Down

0 comments on commit 987c89c

Please sign in to comment.