mastodon / goldfinger

A Webfinger utility for Ruby
MIT License
32 stars 9 forks source link

Fall back to parsing the body even if an invalid content type is returned #8

Open aaronpk opened 6 years ago

aaronpk commented 6 years ago

Currently, if /.well-known/webfinger returns HTTP 200 and a valid webfinger response, but returns a generic content type like application/octet-stream, this library throws an error. Instead, it should fall back and parse the document anyway, probably assuming it's XML format. Bonus points if it can inspect the first character and handle JSON or XML appropriately.

This library already does not care what content-type header is returned for the /.well-known/host-meta URL.