Adrian,

With the present implementation of the authentication challenge parser

Basic realm="realm", test

will produce param name: 'test', param value: null, whereas

Basic realm="realm", test=

will produce param name: 'test', param value: ''

I think such behavior is correct. Do you see it differently?

Oleg

PS: I tested the parser with the following test case

    public void testStuff() {
        String challenge = 
          "Basic realm=\"realm\", test1, test2 = ";
        String scheme = null;
        Map elements = null;
        try {
            scheme = AuthChallengeParser.extractScheme(challenge);
            elements = AuthChallengeParser.extractParams(challenge);
        } catch (MalformedChallengeException e) {
            fail("Unexpected exception: " + e.toString());
        }
        assertEquals("basic", scheme);
        assertEquals("realm", elements.get("realm"));
        assertEquals(null, elements.get("test1"));
        assertEquals("", elements.get("test2"));
    }

-----Original Message-----
From: Adrian Sutton [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2003 2:31 AM
To: Commons Project
Subject: Challenge Parser Changes


Hi all,
Somewhere along the way, probably for a good reason, 
AuthChallengeParser was changed so that a challenge string like:

Basic realm="test", noValue

would parse so that in the returned Map, "noValue" would equate to an 
empty string instead of null as it previously did.  I only notice this 
because I've got a test sitting around for it here that I haven't 
checked in yet and it broke.  I just wanted to check what the actual 
behaviour should be.  If it were intended as an external API I'd expect 
the value to be null so there's a distinction between noValue and 
noValue="" but since it's mostly an internal API that's public 
defaulting to an empty string would be okay (and may be required by the 
spec?).

Regards,

Adrian Sutton.
----------------------------------------------
Intencha "tomorrow's technology today"
Ph: 38478913 0422236329
Suite 8/29 Oatland Crescent
Holland Park West 4121
Australia QLD
www.intencha.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to