Open y-code opened 5 years ago
Hello @y-code ,
Thank you, we will look at this request and your pull
Best Regards,
Jonathan
Performance Libraries
context.BulkInsert(list, options => options.BatchSize = 1000);
Entity Framework Extensions • Entity Framework Classic • Bulk Operations • Dapper Plus
Runtime Evaluation
Eval.Execute("x + y", new {x = 1, y = 2}); // return 3
C# Eval Function • SQL Eval Function
Hi, are there any updates on this?
This issue is effecting a large number of websites (facebook.com being another example). While wrapping my code in try { } catch{ }
does the trick, it is not ideal.
Thanks
Description
When I tried to load a page from https://www.jamieoliver.com/ by HtmlWeb.Load method, it failed with an ArgumentException.
It turned out to be because the response headers from the site has
content-encoding: identity
. As per HTTP RFC 2616,identity
isused only in the Accept- Encoding header, and SHOULD NOT be used in the Content-Encoding header.
, so that it is of course that Encoding class does not supportidentity
.Therefore, next, I specified Encoding.UTF8 to OverrideEncoding property and called HtmlDocument.Load method. However, it didn't make any change and I got the same ArgumentException.
I expected OverrideEncoding property make HtmlWeb class to ignore the Content-Encoding in the response headers from server and to decode content by specified encoding in OverrideEncoding property, but it was not the case.
While it allows overriding the encoding specified by server when the encoding name is valid, it would be ideal that it also worked when the server specified encoding name is invalid.
Exception
Project to reproduce issue
https://github.com/y-code/repro-bug-in-html-agility-pack
Further technical details