src/main/java/cloud/tamacat/httpd/util/ReverseUtils.java
public static void copyHttpResponse(HttpResponse targetResponse, HttpResponse response) {
		// Remove hop-by-hop headers
		for (String h : removeResponseHeaders) {
			targetResponse.removeHeaders(h);
		}

		response.setCode(targetResponse.getCode());
		response.setReasonPhrase(targetResponse.getReasonPhrase());
		response.setVersion(targetResponse.getVersion());
		
		Header[] headers = response.getHeaders("Set-Cookie"); //backup Set-Cookie header.
		response.setHeaders(targetResponse.getHeaders()); //clean and reset all headers.
		for (Header h : headers) { //add Set-Cookie headers.
			response.addHeader(h);
		}
	}
/**
	 * <p>Copy the response headers.
	 * @param targetResponse
	 * @param response
	 */
Copy the response headers.
@param targetResponse
@param response
Copy the response headers . @param targetResponse @param response
public static void copyHttpResponse(HttpResponse targetResponse, HttpResponse response) {
		for (String h : removeResponseHeaders) {
			targetResponse.removeHeaders(h);
		}
		response.setCode(targetResponse.getCode());
		response.setReasonPhrase(targetResponse.getReasonPhrase());
		response.setVersion(targetResponse.getVersion());
		Header[] headers = response.getHeaders("Set-Cookie"); 
		response.setHeaders(targetResponse.getHeaders()); 
		for (Header h : headers) { 
			response.addHeader(h);
		}
	}
public static void copyHttpResponse ( HttpResponse targetResponse , HttpResponse response ) { for ( String h : removeResponseHeaders ) { targetResponse . removeHeaders ( h ) ; } response . setCode ( targetResponse . getCode ( ) ) ; response . setReasonPhrase ( targetResponse . getReasonPhrase ( ) ) ; response . setVersion ( targetResponse . getVersion ( ) ) ; Header [ ] headers = response . getHeaders ( "Set-Cookie" ) ; response . setHeaders ( targetResponse . getHeaders ( ) ) ; for ( Header h : headers ) { response . addHeader ( h ) ; } }
<p>Copy the response headers.
<p > Copy the response headers .
// Remove hop-by-hop headers //backup Set-Cookie header. //clean and reset all headers. //add Set-Cookie headers.