hc-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1454680 - /httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java
Date Sat, 09 Mar 2013 09:47:00 GMT
Author: olegk
Date: Sat Mar  9 09:46:59 2013
New Revision: 1454680

URL: http://svn.apache.org/r1454680
Log:
Minor tweak to debug log message

Modified:
    httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java

Modified: httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java
URL: http://svn.apache.org/viewvc/httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java?rev=1454680&r1=1454679&r2=1454680&view=diff
==============================================================================
--- httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java
(original)
+++ httpcomponents/httpclient/trunk/httpclient/src/main/java/org/apache/http/impl/execchain/ProtocolExec.java
Sat Mar  9 09:46:59 2013
@@ -112,9 +112,9 @@ public class ProtocolExec implements Cli
         // 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 Cli
                 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);
+                    }
                 }
 
             }



Mime
View raw message