mirror of
https://github.com/boostorg/url.git
synced 2026-01-19 04:42:15 +00:00
reg-name might have ipv4 prefix
This commit is contained in:
committed by
Alan de Freitas
parent
146c5197b9
commit
3a237c3510
@@ -70,12 +70,29 @@ parse(
|
||||
it0, it - it0);
|
||||
return t;
|
||||
}
|
||||
|
||||
// IPv4address
|
||||
{
|
||||
auto rv = grammar::parse(
|
||||
it, end, ipv4_address_rule);
|
||||
if( rv )
|
||||
{
|
||||
auto it02 = it;
|
||||
auto rv2 = grammar::parse(
|
||||
it, end,
|
||||
detail::reg_name_rule);
|
||||
if (rv2.has_value() &&
|
||||
!rv2->empty())
|
||||
{
|
||||
t.name = string_view(
|
||||
it0, it - it0);
|
||||
t.host_type =
|
||||
urls::host_type::name;
|
||||
t.match = string_view(
|
||||
it0, it - it0);
|
||||
return t;
|
||||
}
|
||||
it = it02;
|
||||
auto const b =
|
||||
rv->to_bytes();
|
||||
std::memcpy(
|
||||
@@ -91,6 +108,7 @@ parse(
|
||||
|
||||
it = it0; // rewind
|
||||
}
|
||||
|
||||
// reg-name
|
||||
{
|
||||
auto rv = grammar::parse(
|
||||
|
||||
@@ -37,6 +37,10 @@ struct parse_test
|
||||
BOOST_TEST_THROWS(r.value(), system_error);
|
||||
}
|
||||
}
|
||||
// reg-name might have ipv4 prefix
|
||||
{
|
||||
BOOST_TEST_NOT(parse_relative_ref("//0.1.0.1%"));
|
||||
}
|
||||
// parse docs
|
||||
{
|
||||
result< url_view > r = parse_relative_ref( "//www.boost.org/index.html?field=value#downloads" );
|
||||
|
||||
@@ -58,6 +58,9 @@ public:
|
||||
|
||||
// magnet link
|
||||
ok(t, "magnet:?xt=urn:btih:d2474e86c");
|
||||
|
||||
// reg-name might have ipv4 prefix
|
||||
ok(t, "http://192.168.0.1.3.a");
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user