Disallow "." as HTTP host.

GitOrigin-RevId: d8f5d746f021167d2752a5c3fd67486966fb47d6
This commit is contained in:
levlam 2019-02-12 17:53:00 +03:00
parent c7fff4539f
commit 6301dd65d7

View File

@ -95,6 +95,9 @@ Result<HttpUrl> parse_url(MutableSlice url, HttpUrl::Protocol default_protocol)
if (host.empty()) { if (host.empty()) {
return Status::Error("URL host is empty"); return Status::Error("URL host is empty");
} }
if (host == ".") {
return Status::Error("Host is invalid");
}
int specified_port = port; int specified_port = port;
if (port == 0) { if (port == 0) {