howsmyssl icon indicating copy to clipboard operation
howsmyssl copied to clipboard

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

Open Piskvor opened this issue 5 years ago • 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.

Piskvor avatar Jan 31 '20 08:01 Piskvor

Oh, a fair idea!

jmhodges avatar Feb 02 '20 02:02 jmhodges