src/main/java/com/findupon/commons/netops/ChloeHttpRequestExecutor.java
/**
	 * Handle the proxy response, if relevant, containing the IP meta response information.
	 * If the proxy headers do exist, {@link RequestMeta#forceProxyReAuth} is called which triggers a re-auth from the proxy
	 * where we can safely set our headers.
	 */
Handle the proxy response, if relevant, containing the IP meta response information.
If the proxy headers do exist,  RequestMeta#forceProxyReAuth is called which triggers a re-auth from the proxy
where we can safely set our headers.
Handle the proxy response if relevant containing the IP meta response information . If the proxy headers do exist RequestMeta#forceProxyReAuth is called which triggers a re - auth from the proxy where we can safely set our headers .
private void processProxyIpResponse(HttpResponse response, HttpContext context, RequestMeta requestMeta) {
		Header proxyIpNotFoundHeader = response.getFirstHeader(proxyIpNotFoundResponseHeader);
		Header proxyIpHeader = response.getFirstHeader(proxyIpResponseHeader);
		if(proxyIpNotFoundHeader != null) {
			logger.warn("[ChloeHttpRequestExecutor] - Proxy IP not found, switching next session. Host: [{}] IP attempted: [{}] Session count: [{}]",
					requestMeta.getHost(), requestMeta.getProxyIp(), requestMeta.getSessionCount());
			requestMeta.switchNextSession(context);
			return;
		}
		String ip;
		if(proxyIpHeader != null
				&& StringUtils.isNotBlank((ip = proxyIpHeader.getValue()))
				&& requestMeta.getProxyIp() == null
				&& requestMeta.proxyUsed()) {
			logger.debug("[ChloeHttpRequestExecutor] - Proxy IP response received, set for next request. IP [{}] Host [{}]", ip, requestMeta.getHost());
			requestMeta.setProxyIp(ip);
			requestMeta.setForceProxyReAuth(true);
		}
	}
private void processProxyIpResponse ( HttpResponse response , HttpContext context , RequestMeta requestMeta ) { Header proxyIpNotFoundHeader = response . getFirstHeader ( proxyIpNotFoundResponseHeader ) ; Header proxyIpHeader = response . getFirstHeader ( proxyIpResponseHeader ) ; if ( proxyIpNotFoundHeader != null ) { logger . warn ( "[ChloeHttpRequestExecutor] - Proxy IP not found, switching next session. Host: [{}] IP attempted: [{}] Session count: [{}]" , requestMeta . getHost ( ) , requestMeta . getProxyIp ( ) , requestMeta . getSessionCount ( ) ) ; requestMeta . switchNextSession ( context ) ; return ; } String ip ; if ( proxyIpHeader != null && StringUtils . isNotBlank ( ( ip = proxyIpHeader . getValue ( ) ) ) && requestMeta . getProxyIp ( ) == null && requestMeta . proxyUsed ( ) ) { logger . debug ( "[ChloeHttpRequestExecutor] - Proxy IP response received, set for next request. IP [{}] Host [{}]" , ip , requestMeta . getHost ( ) ) ; requestMeta . setProxyIp ( ip ) ; requestMeta . setForceProxyReAuth ( true ) ; } }
Handle the proxy response, if relevant, containing the IP meta response information.
Handle the proxy response if relevant containing the IP meta response information .