hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Renat Sabitov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HTTPCLIENT-1652) AuthSchemeBase.challengeState doesn't survive serialisation in BasicAuthCache
Date Thu, 28 May 2015 04:06:17 GMT
Renat Sabitov created HTTPCLIENT-1652:

             Summary: AuthSchemeBase.challengeState doesn't survive serialisation in BasicAuthCache
                 Key: HTTPCLIENT-1652
                 URL: https://issues.apache.org/jira/browse/HTTPCLIENT-1652
             Project: HttpComponents HttpClient
          Issue Type: Bug
          Components: HttpAuth
    Affects Versions: 4.4.1
            Reporter: Renat Sabitov

If a BasicScheme with ChallengeState defined is put in a BasicAuthCache, it comes out of the
cache with null challengeState.

This is a small test to demonstrate the problem:

    public void assertChallengeStateSurvivesSerialisation() throws Exception {
        BasicAuthCache localCache = new BasicAuthCache();
        HttpHost aHost = new HttpHost("sample.host", 80);

        BasicScheme proxyScheme = new BasicScheme();
                new BasicHeader(HttpHeaders.PROXY_AUTHENTICATE, "Basic "));

        assertThat(proxyScheme.getChallengeState(), is(ChallengeState.PROXY));

        localCache.put(aHost, proxyScheme);

        BasicScheme outOfCache = (BasicScheme) localCache.get(aHost);
        assertThat(outOfCache.getChallengeState(), is(ChallengeState.PROXY));

result is:
Expected: is <PROXY>
     but: was null

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: dev-unsubscribe@hc.apache.org
For additional commands, e-mail: dev-help@hc.apache.org

View raw message