Skip to content

Commit

Permalink
Merge pull request #2526 from alphagov/PP-6703-fix-worldpay-3ds-cooki…
Browse files Browse the repository at this point in the history
…e-issue

PP-6703 Set cookie header directly for gateway request
  • Loading branch information
stephencdaly authored Sep 8, 2020
2 parents 9323267 + 950fda2 commit e3613f2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public GatewayClient.Response postRequestFor(URI url,

Builder requestBuilder = client.target(url).request();
headers.keySet().forEach(headerKey -> requestBuilder.header(headerKey, headers.get(headerKey)));
cookies.forEach(cookie -> requestBuilder.cookie(cookie.getName(), cookie.getValue()));
cookies.forEach(cookie -> requestBuilder.header("Cookie", cookie.getName() + "=" + cookie.getValue()));
response = requestBuilder.post(Entity.entity(request.getPayload(), request.getMediaType()));
int statusCode = response.getStatus();
Response gatewayResponse = new Response(response);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void shouldIncludeCookieIfSessionIdentifierAvailableInOrder() throws Exce
ImmutableList.of(new HttpCookie("machine", "value")), emptyMap());

InOrder inOrder = Mockito.inOrder(mockBuilder);
inOrder.verify(mockBuilder).cookie("machine", "value");
inOrder.verify(mockBuilder).header("Cookie", "machine=value");
inOrder.verify(mockBuilder).post(Entity.entity(orderPayload, mediaType));
}
}

0 comments on commit e3613f2

Please sign in to comment.