DefaultRequestDirector.java (httpcomponents-client-4.5.7-src) | : | DefaultRequestDirector.java (httpcomponents-client-4.5.8-src) | ||
---|---|---|---|---|
skipping to change at line 337 | skipping to change at line 337 | |||
protected void rewriteRequestURI( | protected void rewriteRequestURI( | |||
final RequestWrapper request, | final RequestWrapper request, | |||
final HttpRoute route) throws ProtocolException { | final HttpRoute route) throws ProtocolException { | |||
try { | try { | |||
URI uri = request.getURI(); | URI uri = request.getURI(); | |||
if (route.getProxyHost() != null && !route.isTunnelled()) { | if (route.getProxyHost() != null && !route.isTunnelled()) { | |||
// Make sure the request URI is absolute | // Make sure the request URI is absolute | |||
if (!uri.isAbsolute()) { | if (!uri.isAbsolute()) { | |||
final HttpHost target = route.getTargetHost(); | final HttpHost target = route.getTargetHost(); | |||
uri = URIUtils.rewriteURI(uri, target, true); | uri = URIUtils.rewriteURI(uri, target, URIUtils.DROP_FRAGMEN T_AND_NORMALIZE); | |||
} else { | } else { | |||
uri = URIUtils.rewriteURI(uri); | uri = URIUtils.rewriteURI(uri); | |||
} | } | |||
} else { | } else { | |||
// Make sure the request URI is relative | // Make sure the request URI is relative | |||
if (uri.isAbsolute()) { | if (uri.isAbsolute()) { | |||
uri = URIUtils.rewriteURI(uri, null, true); | uri = URIUtils.rewriteURI(uri, null, URIUtils.DROP_FRAGMENT_ AND_NORMALIZE); | |||
} else { | } else { | |||
uri = URIUtils.rewriteURI(uri); | uri = URIUtils.rewriteURI(uri); | |||
} | } | |||
} | } | |||
request.setURI(uri); | request.setURI(uri); | |||
} catch (final URISyntaxException ex) { | } catch (final URISyntaxException ex) { | |||
throw new ProtocolException("Invalid URI: " + | throw new ProtocolException("Invalid URI: " + | |||
request.getRequestLine().getUri(), ex); | request.getRequestLine().getUri(), ex); | |||
} | } | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |