Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Work around for servers that send unquoted algorithm information #2

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

akurz
Copy link

@akurz akurz commented Jun 15, 2018

Please consider to merge this pull request as a workaround for misbehaving(?) servers that don't quote the algorithm header information.

thx & cheers,
Andreas

@peter-mogensen
Copy link

I honestly don't think the servers are misbehaving.
According to RFC7235 Appendix C auth-param values only need to be quoted if they cannot be represented as a RFC7230 token.

So ... yeah... that's a bug. But it's a bug caused by the rather simple parsing of the WWW-Authenticate header, using strings.Split() and strings.Contains() on '"', which you patch then build upon also doing it for '=' ...
I don't think your patch introduces more cases where it'll fail for valid input (apart from also capturing any BWS between = and token), but I think this in general needs an overhaul to be an actual RFC7616 implementation.

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.

2 participants