mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Loosen restriction on valid hostnames
This changes fixes an issue with GitPod integration, where large numbers in a hostname were incorrectly causing redbean to refuse a request.
This commit is contained in:
parent
c9e68b0ebc
commit
896db8843f
2 changed files with 15 additions and 7 deletions
|
@ -29,7 +29,6 @@ TEST(IsAcceptableHost, test) {
|
|||
EXPECT_TRUE(IsAcceptableHost("1.2.3.4.5.arpa", -1));
|
||||
EXPECT_TRUE(IsAcceptableHost("255.255.255.255", -1));
|
||||
EXPECT_FALSE(IsAcceptableHost("255.255.255", -1));
|
||||
EXPECT_FALSE(IsAcceptableHost("256.255.255.255", -1));
|
||||
EXPECT_TRUE(IsAcceptableHost("hello.example", -1));
|
||||
EXPECT_FALSE(IsAcceptableHost("hello..example", -1));
|
||||
EXPECT_TRUE(IsAcceptableHost("hello", -1));
|
||||
|
@ -46,6 +45,10 @@ TEST(IsAcceptableHost, test) {
|
|||
EXPECT_TRUE(IsAcceptableHost("there-.example", -1));
|
||||
EXPECT_FALSE(IsAcceptableHost("ther#e.example", -1));
|
||||
EXPECT_TRUE(IsAcceptableHost("localhost", -1));
|
||||
EXPECT_TRUE(IsAcceptableHost("8080-gitpodio-empty-abs4xad1abc", -1));
|
||||
EXPECT_TRUE(IsAcceptableHost("ws-eu53", -1));
|
||||
EXPECT_TRUE(IsAcceptableHost("gitpod", -1));
|
||||
EXPECT_TRUE(IsAcceptableHost("io", -1));
|
||||
}
|
||||
|
||||
TEST(IsAcceptablePort, test) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue