I have a simple http rest api, which works perfectly when using the ip address directly. I made a dns A record (unproxied) pointing my domain to the ip address, which a traceroute confirms works. However, when using the domain in the browser, an ERR_INVALID_HTTP_RESPONSE error was displayed. Doing the same request in postman showed the error was “Error: Parse Error: Expected HTTP/”. The site still works perfectly with the ip.
The site uses http, I was using http to connect, and encryption mode on Cloudflare was off.
Yeah, it seems to be an issue with the HTTP response and you would need to check out your server code for that. As I mentioned, the record is unproxied, so that response comes straight from your server.
hm, odd.
my server uses the builtin sun http server in java, com.sun.net.httpserver.HttpServer.
i dont modify any headers, except Content-Type, setting it to application/json. The method i use to initiate the response (sendResponseHeaders()) actually starts the response with "HTTP/1.1 "+rCode+Code.msg(rCode)+"\r\n", so i really cant explain to myself why it seems to be missing in postman and the browser