mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
Handle empty ports
This commit is contained in:
parent
1e16a54ee5
commit
7989e3192d
2 changed files with 18 additions and 1 deletions
|
|
@ -33,7 +33,7 @@ ParsedURL::Authority ParsedURL::Authority::parse(std::string_view encodedAuthori
|
|||
}();
|
||||
|
||||
auto port = [&]() -> std::optional<uint16_t> {
|
||||
if (!parsed->has_port())
|
||||
if (!parsed->has_port() || parsed->port() == "")
|
||||
return std::nullopt;
|
||||
/* If the port number is non-zero and representable. */
|
||||
if (auto portNumber = parsed->port_number())
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue