Skip to content

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