Commit b59102a8 authored by Luis Javier Merino's avatar Luis Javier Merino Committed by Tomaz Canabrava
Browse files

URI regexp: support ? in query and fragment

The query and fragment components can include question marks in them. As
an example, LDAP URIs have queries of the form:

["?" [attributes] ["?" [scope] ["?" [filter] ["?" extensions]]]]]]

so the following:

ldap://[2001:db8::7]/c=GB?objectClass?one

does a one-level deep query to the LDAP server at IPv6 address
2001:db8::7 for the children of object c=GB and returns their
objectClass attribute.
parent 45c0025c
......@@ -71,6 +71,9 @@ void HotSpotFilterTest::testUrlFilterRegex_data()
<< "http://[2a00:1450:4001:829::200e]/" << true;
QTest::newRow("ipv6_with_port") << "http://[2a00:1450:4001:829::200e]:80/"
<< "http://[2a00:1450:4001:829::200e]:80/" << true;
QTest::newRow("query_with_question_marks") << "ldap://[2001:db8::7]/c=GB?objectClass?one"
<< "ldap://[2001:db8::7]/c=GB?objectClass?one" << true;
}
void HotSpotFilterTest::testUrlFilterRegex()
......
......@@ -52,8 +52,8 @@ static const char port[] = "(?::[0-9]+)?+"; // :1234
#define COMMON_2 "a-z0-9\\-._~%!$&'()*+,;=:@/"
static const char path[] = "(?:/[" COMMON_2 "]*+)?+"; // /path/to/some/place
static const char query[] = "(?:\\?[" COMMON_2 "]+)?+"; // "?somequery=bar"
static const char fragment[] = "(?:#[" COMMON_2 "]+)?+"; // "#fragment"
static const char query[] = "(?:\\?[" COMMON_2 "?]+)?+"; // "?somequery=bar"
static const char fragment[] = "(?:#[" COMMON_2 "?]+)?+"; // "#fragment"
using LS1 = QLatin1String;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment