When receiving a HTTP response without a statusline, "nil" is returned as reponse headers and status line values, but the response code will still be "200 Success", which is quite not right as there wasn't ever a response status code received. This patch adds a check for a status line, and returns with an early error if needed. This condition can be triggered by trying to speak plain HTTP to a HTTPS-enabled server, e.g. using http://matrix.org:8448 instead of https://matrix.org:8448 as homeserver URL.
2.1 KiB
2.1 KiB