Skip to content

Commit

Permalink
fix java21 wormhole prober in QA.
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 665685817
Change-Id: Ie77b14e37dc2384166a3cb2177118907e768c6aa
  • Loading branch information
ludoch authored and gae-java-bot committed Aug 21, 2024
1 parent d576d17 commit aa4c015
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion applications/proberapp/src/main/java/app/ProberApp.java
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,8 @@ private static void testRemoteAPI(HttpServletRequest request) throws Exception {

/** Test sessions. Hit servlet twice and verify session count changes. */
private static void testSessions(HttpServletRequest request) throws Exception {
// Avoid jetty12 introspection class loader useless issues:
System.setProperty("com.google.common.truth.disable_stack_trace_cleaning", "true");
String baseUrl = request.getRequestURL().toString();
URL url = new URL(baseUrl + "/session");

Expand Down Expand Up @@ -792,7 +794,13 @@ private static void testSessions(HttpServletRequest request) throws Exception {
assertThat(cookie).isPresent();

// Set cookie on subsequent request
httpRequest.setHeader(new HTTPHeader("Cookie", cookie.get()));
// Stripping the last 2 fields "JSESSIONID=XqmmOsTY2SLPIamiDtIHHQ.node0; Path=/; Secure"
// b/359557991
String jSessionId =
cookie.get().endsWith("; Path=/; Secure")
? cookie.get().substring(0, cookie.get().length() - "; Path=/; Secure".length())
: cookie.get();
httpRequest.setHeader(new HTTPHeader("Cookie", jSessionId));

// Second request
HTTPResponse response2 = getResponse(httpRequest);
Expand Down

0 comments on commit aa4c015

Please sign in to comment.