-
-
Notifications
You must be signed in to change notification settings - Fork 48
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
Check if request headers exist #128
Conversation
These headers are not guaranteed.
As a side note, @Shazwazza, how useful is the IE6 check still? Maybe remove it? I doubt anyone uses that ancient browser anymore. |
Yep we can remove that check :) can you update the PR with the change? |
Done :) |
src/Smidge/RequestHelper.cs
Outdated
|
||
CompressionType parsed = CompressionType.Parse(encoding); | ||
|
||
// Brotli is typically last in the accept encoding header. | ||
if (parsed == CompressionType.Brotli) | ||
if (parsed.Equals(CompressionType.Brotli)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to do any invariant checking for Equals here or no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is a struct. I changed it to Equals instead of == because VS was warning about a not implemented == operator (seems like a VS bug as CompressionType implements the == operator as well).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Shazwazza Reverted these changes, if you could merge and release a new version on NuGet that'd be great 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks fine.
Ahh, you already said that. I think it will since it's trying to read from the dictionary correctly. |
Yes, this fixes that problem, it's the same issue I had. The User-Agent header I can understand missing but I also had some Chrome browsers not sending Accept-Encoding for whatever reason. |
Cool, i've just published the release 👍 |
These headers are not guaranteed.