Skip to content

Commit

Permalink
Merge pull request #15747 from iterate-ch/bugfix/CTERA-141
Browse files Browse the repository at this point in the history
Handle missing cookie in response.
  • Loading branch information
dkocher committed Mar 19, 2024
2 parents 7153ba4 + 25ffd91 commit fd2c09e
Showing 1 changed file with 8 additions and 3 deletions.
Expand Up @@ -62,9 +62,14 @@ public void authenticate() throws BackgroundException {
session.getClient().execute(login, new AbstractResponseHandler<Void>() {
@Override
public Void handleResponse(final HttpResponse response) throws IOException {
final Header header = response.getFirstHeader("Set-Cookie");
if(log.isDebugEnabled()) {
log.debug(String.format("Received cookie %s", header));
if(!response.containsHeader("Set-Cookie")) {
log.warn(String.format("No cookie in response %s", response));
}
else {
final Header header = response.getFirstHeader("Set-Cookie");
if(log.isDebugEnabled()) {
log.debug(String.format("Received cookie %s", header));
}
}
return super.handleResponse(response);
}
Expand Down

0 comments on commit fd2c09e

Please sign in to comment.