The second example is a standard Express server and the first one php. In the browser, curl, wget both requests work perfectly ok. Only Mint (and thus tools using Mint, like Req and Finch) gives me an error.
I can see that the responses are not exactly the same, but I don’t see why it should fail (content-length is nto a required header, and I’ve tried with setting the charset as well, but it doesn’t change the results)
Hi @tcoopman if you’re getting :econnrefused then mint is saying it can’t establish a connection at all, not that it can’t make sense of the response. Can you show your mint code?
Well I would take out the huge hammer i.e. download Mint locally and specify that path in my mix.exs and then pepper that locally downloaded Mint with dbg.
Though it’s likely something else – maybe a security policy or some such – and it might turn out to be the wrong problem to focus on but still, you have to start somewhere.
Ok, found the culprit.
Running php -S localhost:8000 results in the error, but php -S 127.0.0.1:8000 works.
I’m still confused why it’s only gen_tcp that struggles with the connection and no other tools.