Skip to content

Commit 842efec

Browse files
authored
Merge branch 'master' into arc-snmp-2
2 parents c32ae7e + 85b9d6d commit 842efec

File tree

1 file changed

+2
-14
lines changed

1 file changed

+2
-14
lines changed

src/anyp/Uri.cc

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -668,23 +668,11 @@ AnyP::Uri::parseHost(Parser::Tokenizer &tok) const
668668

669669
// no brackets implies we are looking at IPv4address or reg-name
670670

671-
static const CharacterSet IPv4chars = CharacterSet("period", ".") + CharacterSet::DIGIT;
672-
SBuf ipv4ish; // IPv4address-ish
673-
if (tok.prefix(ipv4ish, IPv4chars)) {
674-
// This rejects non-IP addresses that our caller would have
675-
// otherwise mistaken for a domain name (e.g., '127.0.0' or '1234.5').
676-
Ip::Address ipCheck;
677-
if (!ipCheck.fromHost(ipv4ish.c_str()))
678-
throw TextException("malformed IP address in uri-host", Here());
679-
680-
return ipv4ish;
681-
}
682-
683-
// XXX: This code does not detect/reject some bad host values (e.g. "!#$%&").
671+
// XXX: This code does not detect/reject some bad host values (e.g. `!#$%&`).
684672
// TODO: Add more checks here, after migrating the
685673
// non-CONNECT uri-host parsing code to use us.
686674

687-
SBuf otherHost; // IPv4address-ish or reg-name-ish;
675+
SBuf otherHost; // IPv4address-ish or reg-name-ish
688676
// ":" is not in TCHAR so we will stop before any port specification
689677
if (tok.prefix(otherHost, CharacterSet::TCHAR))
690678
return otherHost;

0 commit comments

Comments
 (0)