Minor tweak to debug log message

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1454680 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2013-03-09 09:46:59 +00:00
parent fd5cab185b
commit ec85a83173
1 changed files with 8 additions and 5 deletions

View File

@ -112,9 +112,9 @@ public class ProtocolExec implements ClientExecChain {
// Get user info from the URI
final AuthState targetAuthState = context.getTargetAuthState();
if (targetAuthState != null) {
final URI uri = request.getURI();
if (uri != null) {
final String userinfo = uri.getUserInfo();
final URI requestURI = request.getURI();
if (requestURI != null) {
final String userinfo = requestURI.getUserInfo();
if (userinfo != null) {
targetAuthState.update(new BasicScheme(), new UsernamePasswordCredentials(
userinfo));
@ -151,8 +151,11 @@ public class ProtocolExec implements ClientExecChain {
final String uriString = original.getRequestLine().getUri();
try {
uri = URI.create(uriString);
} catch (IllegalArgumentException e) {
log.debug("Could not parse " + uriString + " as a URI to set Host header");
} catch (final IllegalArgumentException ex) {
if (this.log.isDebugEnabled()) {
this.log.debug("Unable to parse '" + uriString + "' as a valid URI; " +
"request URI and Host header may be inconsistent", ex);
}
}
}