Skip to content

Commit 114bbfb

Browse files
committed
Merge branch 'main' into pythongermany
2 parents 1af58d3 + 5b6ffe9 commit 114bbfb

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/http/VirtualHost.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ VirtualHost *VirtualHost::matchVirtualHost(Address &address, std::string host) {
7676
(*it)->getContext().getDirective("server_name")[0];
7777
for (std::vector<std::string>::const_iterator itSn = serverNames.begin();
7878
itSn != serverNames.end(); ++itSn) {
79-
if (*itSn == host) return *it;
79+
int diff = std::strcmp(itSn->c_str(), host.c_str());
80+
if (!diff || diff == ':' || -diff == ':') return *it;
8081
}
8182
}
8283
}

0 commit comments

Comments
 (0)