httpclient icon indicating copy to clipboard operation
httpclient copied to clipboard

Issue parsing Digest challenge

Open womblep opened this issue 3 years ago • 0 comments

I have a server respond with a challenge of: WWW-Authenticate: Digest realm="realmhere",qop="auth,auth-int",nonce="60b9e1bc89661",opaque="0e3a3074e5fdc57d09"

This causes the response to have ...,qop="auth, ... with the missing quote at the end and that makes the server choke of the response and reject it The problem is in parse_challenge_param because the regex is just looking for commas to signify the sections of the challenge and this value has commas within the value.

I very quickly patched around it for my case by striping off a leading quote if there wasn't a trailing one but that might not be the right solution

Maybe doing a split with a regex of something like this ",(?=([^"]"[^"]")[^"]$)" (note untested, just found on google)

womblep avatar Jun 04 '21 08:06 womblep