"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java" between
httpcomponents-client-4.5.7-src.tar.gz and httpcomponents-client-4.5.8-src.tar.gz

About: HttpComponents is an Apache project responsible for creating and maintaining a toolset of low level Java components focused on HTTP and associated protocols. Java sources.

ProtocolExec.java  (httpcomponents-client-4.5.7-src):ProtocolExec.java  (httpcomponents-client-4.5.8-src)
skipping to change at line 91 skipping to change at line 91
public ProtocolExec(final ClientExecChain requestExecutor, final HttpProcess or httpProcessor) { public ProtocolExec(final ClientExecChain requestExecutor, final HttpProcess or httpProcessor) {
Args.notNull(requestExecutor, "HTTP client request executor"); Args.notNull(requestExecutor, "HTTP client request executor");
Args.notNull(httpProcessor, "HTTP protocol processor"); Args.notNull(httpProcessor, "HTTP protocol processor");
this.requestExecutor = requestExecutor; this.requestExecutor = requestExecutor;
this.httpProcessor = httpProcessor; this.httpProcessor = httpProcessor;
} }
void rewriteRequestURI( void rewriteRequestURI(
final HttpRequestWrapper request, final HttpRequestWrapper request,
final HttpRoute route) throws ProtocolException { final HttpRoute route,
final boolean normalizeUri) throws ProtocolException {
final URI uri = request.getURI(); final URI uri = request.getURI();
if (uri != null) { if (uri != null) {
try { try {
request.setURI(URIUtils.rewriteURIForRoute(uri, route)); request.setURI(URIUtils.rewriteURIForRoute(uri, route, normalize Uri));
} catch (final URISyntaxException ex) { } catch (final URISyntaxException ex) {
throw new ProtocolException("Invalid URI: " + uri, ex); throw new ProtocolException("Invalid URI: " + uri, ex);
} }
} }
} }
@Override @Override
public CloseableHttpResponse execute( public CloseableHttpResponse execute(
final HttpRoute route, final HttpRoute route,
final HttpRequestWrapper request, final HttpRequestWrapper request,
skipping to change at line 132 skipping to change at line 133
if (this.log.isDebugEnabled()) { if (this.log.isDebugEnabled()) {
this.log.debug("Unable to parse '" + uriString + "' as a val id URI; " + this.log.debug("Unable to parse '" + uriString + "' as a val id URI; " +
"request URI and Host header may be inconsistent", ex); "request URI and Host header may be inconsistent", ex);
} }
} }
} }
request.setURI(uri); request.setURI(uri);
// Re-write request URI if needed // Re-write request URI if needed
rewriteRequestURI(request, route); rewriteRequestURI(request, route, context.getRequestConfig().isNormalize Uri());
final HttpParams params = request.getParams(); final HttpParams params = request.getParams();
HttpHost virtualHost = (HttpHost) params.getParameter(ClientPNames.VIRTU AL_HOST); HttpHost virtualHost = (HttpHost) params.getParameter(ClientPNames.VIRTU AL_HOST);
// HTTPCLIENT-1092 - add the port if necessary // HTTPCLIENT-1092 - add the port if necessary
if (virtualHost != null && virtualHost.getPort() == -1) { if (virtualHost != null && virtualHost.getPort() == -1) {
final int port = route.getTargetHost().getPort(); final int port = route.getTargetHost().getPort();
if (port != -1) { if (port != -1) {
virtualHost = new HttpHost(virtualHost.getHostName(), port, virtualHost = new HttpHost(virtualHost.getHostName(), port,
virtualHost.getSchemeName()); virtualHost.getSchemeName());
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 4 lines changed or added

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