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

URI regexp: allow empty queries and fragments

Test:
http://example.com/?
parent b59102a8
......@@ -60,9 +60,9 @@ void HotSpotFilterTest::testUrlFilterRegex_data()
<< "https://example.com/foo,bar" << true;
QTest::newRow("empty_query") << "http://example.com/?"
<< "http://example.com/" << true;
<< "http://example.com/?" << true;
QTest::newRow("empty_fragment") << "http://example.com/#"
<< "http://example.com/" << true;
<< "http://example.com/#" << true;
QTest::newRow("www_followed_by_colon") << "www.example.com:foo@bar.com"
<< "www.example.com" << true;
......
......@@ -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