Skip to content

Commit 99228e5

Browse files
committed
Propagate the correct has_host value when parsing a file hostname
1 parent cc2b3f4 commit 99228e5

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/parser.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -1025,14 +1025,20 @@ impl<'a> Parser<'a> {
10251025
&mut self,
10261026
input: Input<'i>,
10271027
) -> ParseResult<(bool, HostInternal, Input<'i>)> {
1028-
let (has_host, host_str, remaining) = Parser::file_host(input)?;
1028+
let has_host;
1029+
let (_, host_str, remaining) = Parser::file_host(input)?;
10291030
let host = if host_str.is_empty() {
1031+
has_host = false;
10301032
HostInternal::None
10311033
} else {
10321034
match Host::parse(&host_str)? {
1033-
Host::Domain(ref d) if d == "localhost" => HostInternal::None,
1035+
Host::Domain(ref d) if d == "localhost" => {
1036+
has_host = false;
1037+
HostInternal::None
1038+
}
10341039
host => {
10351040
write!(&mut self.serialization, "{}", host).unwrap();
1041+
has_host = true;
10361042
host.into()
10371043
}
10381044
}

0 commit comments

Comments
 (0)