jmhodges/howsmyssl

Redirect from howsmytls.com to howsmyssl.com returns text/html even on the JSON endpoint

Opened this issue · 1 comments

The redirect response at https://www.howsmytls.com/a/check returns

HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=utf-8
Location: https://www.howsmyssl.com/a/check

<a href="https://www.howsmyssl.com/a/check">Moved Permanently</a>.

This is always returned, even for requests with Accept: application/json. At this point, this is somewhat academic; but would become common when the domains are switched, and www.howsmytls.com becomes canonical.

Perhaps returning an empty JSON object {} would be useful here, or perhaps populating the Error field:
{ error: "Moved permanently: https://www.howsmyssl.com/a/check" } - the 301 response should be sufficient for a redirect, but if the redirect also returns a body, it probably should be in the expected MIME type.

Oh, a fair idea!