keepcosmos / readability

Readability is Elixir library for extracting and curating articles.
Apache License 2.0
254 stars 58 forks source link

Do a case-insensitive content-type check #33

Closed adlan closed 7 years ago

adlan commented 7 years ago

While doing some fix yesterday, I ran a local web server hosting some articles I want to test. However, I noticed that the library parse all the articles I host as plain-text instead of HTML. I checked and found that the reason that happens is that the web server set the header content-type key in a different case thus failing the "Content-Type" check in the library.

According to RFC 2616 (Section 4.2), the HTTP header field names are case-insensitive.

keepcosmos commented 7 years ago

Thanks! :)