Github user ok2c commented on a diff in the pull request:

    https://github.com/apache/httpclient/pull/55#discussion_r71292523
  
    --- Diff: 
httpclient5/src/main/java/org/apache/hc/client5/http/impl/auth/SystemDefaultCredentialsProvider.java
 ---
    @@ -88,35 +93,51 @@ public void setCredentials(final AuthScope authscope, 
final Credentials credenti
     
         private static PasswordAuthentication getSystemCreds(
                 final AuthScope authscope,
    -            final Authenticator.RequestorType requestorType) {
    +            final Authenticator.RequestorType requestorType,
    +            final HttpContext context) {
             final String hostname = authscope.getHost();
             final int port = authscope.getPort();
             final HttpHost origin = authscope.getOrigin();
             final String protocol = origin != null ? origin.getSchemeName() :
                     (port == 443 ? "https" : "http");
    +
    +        final URL targetHostURL;
    +        if (context != null) {
    +            final HttpUriRequest httpUriRequest = (HttpUriRequest) 
context.getAttribute(HttpCoreContext.HTTP_REQUEST);
    --- End diff --
    
    One cannot assume the request object in the context to be always of type of 
HttpUriRequest. It would be safer to use the generic HttpRequest type here. 
    
    Otherwise everything looks good to me.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to