Missing Response.statusText under HTTPS (e.g. Unauthorized is empty string)

We have a generic error handling, that shows an error to the user when a request fails.

The error contains information on when it happened, and the status text of the response. (response.statusText).

Recently we discovered that the statusText was missing in the screenshot of one our the reported bugs. It turned out that response.statusText is present only if you don’t use HTTPS. When you use HTTPS, the browser and the server switch to HTTP/2, which does not support response.statusText – just response.status, that holds the status code.

Our quick fix only showed the status code, despite making it less user-friendly.


Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.