magiconair / properties

Java properties scanner for Go
BSD 2-Clause "Simplified" License
323 stars 77 forks source link

Made Content-Type check whitespace agnostic in LoadURL() #42

Closed aliras1 closed 4 years ago

aliras1 commented 4 years ago

When loading properties from URLs, if a web server defined its Content-Type without any whitespaces between the text type and charset, the load fails with an invalid content type error. E.g. text/plain;charset=utf-8 instead of text/plain; charset=utf-8.

This PR makes the Content-Type check whitespace agnostic by removing all whitespace characters from the header field and comparing it to the appropriate strings.

aliras1 commented 4 years ago

@magiconair, any thoughts on this PR?