IDNA Domains Appear Broken
I'm trying to set up epicyon on a domain that looks like this: social.domaín.ie
It starts and runs fine, seemingly, but it logs that it's rejecting requests when they come in, and the log indicates the punycode domain name.
I've been having issues with Caddy and IDNA also, so I held off on opening an issue here, but even though I haven't solved the Caddy issue I think I've shaken this enough to blame epicyon also.
So, the issue here is that Firefox and many other services will just turn an IDN URL into its punycode form before issuing a request. So, the example domain social.domaín.ie might become social.xn--doman-2sa.ie.
The immediate problem with epicyon then is that it's rejecting the punycode version of a domain name.
If I make a direct request to epicyon from Python + requests, it succeeds, and the log output shows the domain in MIME encoding:
requests.get("http://localhost:7156', headers={'Host': 'social.domaín.ie'})
..this succeeds, and the output in the log shows a MIME encoded domain that looks like this (partly redacted because the output is from my test domain that isn't ready for the bots):
Host: =?utf-8?b?<redacted>?=
..I actually did wonder whether Requests encodes the header this way for unicode domain names, but I haven't found evidence to support this theory yet. I tried leveraging it by manually setting the header to this value when making requests with e.g. curl but epicyon rejects these requests and displays the encoded domain exactly as sent, so I think maybe it's just a logging thing, when epicyon (/ builtin Python HTTP tools) successfully receives a UTF domain it logs it in MIME?
Also worth noting is that when I make a curl request to Epicyon with the unmodified unicode domain as an explicit Host header, it still fails and the logs show a malformed character in the output. E.g.
curl 'localhost:7156' -H 'Host: social.domaín.ie
..comes up in the logs as:
Jan 22 00:49:00 vpsfoo python3[594]: GET domain blocked: social.domaà n.ie
..again, this could just be something broken in the logs, but the explicit unicode header fails to be accepted by epicyon when issued through Curl.
TLDR: I think if epicyon could support punycode for domain names, it would help resolve this issue. If it does already, are there any special considerations that need to be put in place to make things work?