"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient5/src/main/java/org/apache/hc/client5/http/impl/classic/RedirectExec.java" between
httpcomponents-client-5.2-src.tar.gz and httpcomponents-client-5.2.1-src.tar.gz

About: Apache HttpComponents Client provides reusable components for client-side authentication, HTTP state management, and HTTP connection management. Java sources.

RedirectExec.java  (httpcomponents-client-5.2-src):RedirectExec.java  (httpcomponents-client-5.2.1-src)
skipping to change at line 32 skipping to change at line 32
* individuals on behalf of the Apache Software Foundation. For more * individuals on behalf of the Apache Software Foundation. For more
* information on the Apache Software Foundation, please see * information on the Apache Software Foundation, please see
* <http://www.apache.org/>. * <http://www.apache.org/>.
* *
*/ */
package org.apache.hc.client5.http.impl.classic; package org.apache.hc.client5.http.impl.classic;
import java.io.IOException; import java.io.IOException;
import java.net.URI; import java.net.URI;
import java.util.Objects;
import org.apache.hc.client5.http.CircularRedirectException; import org.apache.hc.client5.http.CircularRedirectException;
import org.apache.hc.client5.http.HttpRoute; import org.apache.hc.client5.http.HttpRoute;
import org.apache.hc.client5.http.RedirectException; import org.apache.hc.client5.http.RedirectException;
import org.apache.hc.client5.http.auth.AuthExchange; import org.apache.hc.client5.http.auth.AuthExchange;
import org.apache.hc.client5.http.classic.ExecChain; import org.apache.hc.client5.http.classic.ExecChain;
import org.apache.hc.client5.http.classic.ExecChainHandler; import org.apache.hc.client5.http.classic.ExecChainHandler;
import org.apache.hc.client5.http.config.RequestConfig; import org.apache.hc.client5.http.config.RequestConfig;
import org.apache.hc.client5.http.protocol.HttpClientContext; import org.apache.hc.client5.http.protocol.HttpClientContext;
import org.apache.hc.client5.http.protocol.RedirectLocations; import org.apache.hc.client5.http.protocol.RedirectLocations;
skipping to change at line 59 skipping to change at line 60
import org.apache.hc.core5.http.ClassicHttpResponse; import org.apache.hc.core5.http.ClassicHttpResponse;
import org.apache.hc.core5.http.HttpEntity; import org.apache.hc.core5.http.HttpEntity;
import org.apache.hc.core5.http.HttpException; import org.apache.hc.core5.http.HttpException;
import org.apache.hc.core5.http.HttpHost; import org.apache.hc.core5.http.HttpHost;
import org.apache.hc.core5.http.HttpStatus; import org.apache.hc.core5.http.HttpStatus;
import org.apache.hc.core5.http.Method; import org.apache.hc.core5.http.Method;
import org.apache.hc.core5.http.ProtocolException; import org.apache.hc.core5.http.ProtocolException;
import org.apache.hc.core5.http.io.entity.EntityUtils; import org.apache.hc.core5.http.io.entity.EntityUtils;
import org.apache.hc.core5.http.io.support.ClassicRequestBuilder; import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
import org.apache.hc.core5.util.Args; import org.apache.hc.core5.util.Args;
import org.apache.hc.core5.util.LangUtils;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
/** /**
* Request execution handler in the classic request execution chain * Request execution handler in the classic request execution chain
* responsible for handling of request redirects. * responsible for handling of request redirects.
* <p> * <p>
* Further responsibilities such as communication with the opposite * Further responsibilities such as communication with the opposite
* endpoint is delegated to the next executor in the request execution * endpoint is delegated to the next executor in the request execution
* chain. * chain.
skipping to change at line 172 skipping to change at line 172
} else { } else {
redirectBuilder = ClassicRequestBuilder.copy(sco pe.originalRequest); redirectBuilder = ClassicRequestBuilder.copy(sco pe.originalRequest);
} }
break; break;
default: default:
redirectBuilder = ClassicRequestBuilder.copy(scope.o riginalRequest); redirectBuilder = ClassicRequestBuilder.copy(scope.o riginalRequest);
} }
redirectBuilder.setUri(redirectUri); redirectBuilder.setUri(redirectUri);
final HttpRoute currentRoute = currentScope.route; final HttpRoute currentRoute = currentScope.route;
if (!LangUtils.equals(currentRoute.getTargetHost(), newTarge t)) { if (!Objects.equals(currentRoute.getTargetHost(), newTarget) ) {
final HttpRoute newRoute = this.routePlanner.determineRo ute(newTarget, context); final HttpRoute newRoute = this.routePlanner.determineRo ute(newTarget, context);
if (!LangUtils.equals(currentRoute, newRoute)) { if (!Objects.equals(currentRoute, newRoute)) {
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("{} new route required", exchangeId); LOG.debug("{} new route required", exchangeId);
} }
final AuthExchange targetAuthExchange = context.getA uthExchange(currentRoute.getTargetHost()); final AuthExchange targetAuthExchange = context.getA uthExchange(currentRoute.getTargetHost());
if (LOG.isDebugEnabled()) { if (LOG.isDebugEnabled()) {
LOG.debug("{} resetting target auth state", exch angeId); LOG.debug("{} resetting target auth state", exch angeId);
} }
targetAuthExchange.reset(); targetAuthExchange.reset();
if (currentRoute.getProxyHost() != null) { if (currentRoute.getProxyHost() != null) {
final AuthExchange proxyAuthExchange = context.g etAuthExchange(currentRoute.getProxyHost()); final AuthExchange proxyAuthExchange = context.g etAuthExchange(currentRoute.getProxyHost());
 End of changes. 4 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)