Skip to content

Fix unquote IndexError on empty string input#3771

Open
bysiber wants to merge 1 commit intoencode:masterfrom
bysiber:fix/unquote-empty-string-crash
Open

Fix unquote IndexError on empty string input#3771
bysiber wants to merge 1 commit intoencode:masterfrom
bysiber:fix/unquote-empty-string-crash

Conversation

@bysiber
Copy link

@bysiber bysiber commented Feb 20, 2026

unquote('') in _utils.py raises IndexError because it accesses value[0] without checking string length first.

This can occur when parsing digest auth WWW-Authenticate headers containing parameters with empty unquoted values (e.g. realm= instead of realm="").

`unquote('')` raises `IndexError` because it accesses `value[0]`
without checking the string length first. This can occur when parsing
digest auth WWW-Authenticate headers containing parameters with empty
unquoted values (e.g. `realm=` instead of `realm=""`).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments