Closed pi0 closed 1 week ago
The shortest valid minimum HTTP hostname is at least 11 characters long (http://a.bc) which is why the code is hardcoded to start checking a pathname after the first 11 characters for optimization.
Can you give me some uses of the non-standard HTTP hostname?
Internet hosts can be as short as one character (rfc1123#2.1) and above usage can be at least used in loopback and container-to-container scenarios (where no public DNS resolver is involved) so it is valid.
I've checked and the difference is less than the magnitude of pico-seconds to check more chars, BTW feel free to close the issue if feel it is not a valid case for Elysia.
I agree Elysia should remove these kind of optimizations in favor of correctness. Skipping 11 characters doesn’t make any difference other than in artificial benchmarks
We start an implementation of a non-default standardHostname
config to start matching a character after http://
(7 character instead of 11) as an initial implementation on 1678c63 published under 1.1.8.
If you have more use-case, feels free to open a new discussion on discussion tab. We would like to hear to thought, thanks.
What version of Elysia.JS is running?
1.1.3
What platform is your computer?
Darwin 24.0.0 arm64 arm
What steps can reproduce the bug?
What is the expected behavior?
What do you see instead?
Additional information
It seems issue rases from here since path parsing starts at char
11
of URL (i think assuming there is alwaysh:p
(host port)