<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Exchange Server">
<!-- converted from rtf -->
<style><!-- .EmailQuote { margin-left: 1pt; padding-left: 4pt; border-left: #800000 2px solid; } --></style>
</head>
<body>
<font face="Calibri, sans-serif" size="2">
<div>Hello,</div>
<div>&nbsp;</div>
<div>Is it possible to get the full content of a response body before it&#8217;s sent?&nbsp; I&#8217;m trying to sign the response and add this signature in a header.&nbsp; There was a similar question on this list a couple of weeks ago, but that one was about signing the incoming
request.&nbsp; My current approach is, in HttpHandler.handleRequest():</div>
<div>&nbsp;</div>
<div>- Create a javax.crypto.Signature object</div>
<div>- Use HttpServerExchange. addResponseWrapper() to add a StreamSinkConduit that updates the Signature object as write() is called</div>
<div>- Use HttpServerExchange.addResponseCommitListener() to add a callback that calls Signature.sign() when the response is ready to be sent</div>
<div>&nbsp;</div>
<div>Good in theory, but I&#8217;m finding that the sign happens before the updates &#8211; looks like the Conduit is only active as the response is being sent.&nbsp; Is there something else I should wrap to get the bytes as they&#8217;re being added to the response?&nbsp; Even better
would be if I could read them directly from the ResponseCommitListener.beforeCommit() callback.&nbsp; I can see the number of bytes that have been written, but not the actual data.</div>
<div>&nbsp;</div>
<div>Note: I&#8217;m using Undertow 1.2.x, as we&#8217;re on WildFly 9.</div>
<div>&nbsp;</div>
<div>-- </div>
<div>Vikas Nagaraj</div>
<div><a href="mailto:vikas.nagaraj@safenet-inc.com"><font color="#0000FF"><u>vikas.nagaraj@safenet-inc.com</u></font></a></div>
<div>&nbsp;</div>
<div>&nbsp;</div>
<div>&nbsp;</div>
</font>
</body>
</html>

<br>
The information contained in this electronic mail transmission <br/>may be privileged and confidential, and therefore, protected <br/>from disclosure. If you have received this communication in <br/>error, please notify us immediately by replying to this <br/>message and deleting it from your computer without copying <br/>or disclosing it.<br/><br/>