<div dir="ltr">Hi,<div><br></div><div>I am currently using a customer handler wrapping the proxy handler. I want to set some response headers from my handler, but if they exist in the response from the proxy&#39;s backend, they are overridden. Example code:</div><div><br>Undertow.builder()<div>  .addHttpListener(8080, &quot;localhost&quot;)</div><div>  .setHandler(new MyHandler(new ProxyHandler(proxy, 30000, ResponseCodeHandler.<span class="">HANDLE_404</span>))).build();<br></div><div><br><div>class MyHandler extends HttpHandler {</div><div>  private static final HttpString ACCESS_CONTROL_EXPOSE_HEADERS = new HttpString(&quot;Access-Control-Expose-Headers&quot;);</div><div>  private HTTPHandler next;</div><div>  public MyHandler(HttpHandler next) {</div><div>    this.next = next;</div><div>  }<br>  p<span class="">ublic </span> <span class="">void</span> handleRequest(HttpServerExchange <span class="">exchange</span>) <span class="">throws</span> Exception {</div><div>    <span class="">exchange</span>.getResponseHeaders().put(<span class="">ACCESS_CONTROL_EXPOSE_HEADERS</span>, &quot;<span class="">new ACEH&quot;</span>);<br>  }<br>}<br><br>







</div></div><div>The problem here is that the backend server responds with an Access-Control-Expose-Headers header and that replaces the one I set in MyHandler.</div><div><br></div><div>Is there any way I can change headers after proxy has received the response from backend and before it starts sending the response to the client?</div><div><br></div><div>Regards,</div><div>Jeff</div><div><br></div></div></div>