Skip to content

Commit aaaed83

Browse files
committed
Actually pass the response body to CommandListener implementations, per the interface contract.
Fixes SeleniumHQ#6878: TestSession>forward()>contentBeingForwarded always null in CommandListener.afterCommand(). Thanks suayipozmen for the find and the fix.
1 parent 11e9cc6 commit aaaed83

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

java/server/src/org/openqa/grid/internal/TestSession.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ public String forward(SeleniumBasedRequest request, HttpServletResponse response
265265
final byte[] bytes = drainInputStream(in);
266266
writeRawBody(response, bytes);
267267

268+
contentBeingForwarded = bytes;
268269
} finally {
269270
EntityUtils.consume(responseBody);
270271
}
@@ -276,7 +277,9 @@ public String forward(SeleniumBasedRequest request, HttpServletResponse response
276277
wrappedResponse.setForwardedContent(contentBeingForwarded);
277278
((CommandListener) slot.getProxy()).afterCommand(this, request, wrappedResponse);
278279
}
280+
279281
response.flushBuffer();
282+
280283
return res;
281284
} finally {
282285
forwardingRequest = false;

0 commit comments

Comments
 (0)