@@ -86,10 +86,15 @@ namespace boost { namespace network { namespace uri {
86
86
parts.fragment
87
87
);
88
88
89
- qi::rule<iterator, string_type::value_type ()> reserved = qi::char_ (" ;/?:@&=+$," );
90
- qi::rule<iterator, string_type::value_type ()> unreserved = qi::alnum | qi::char_ (" -_.!~*'()" );
91
- qi::rule<iterator, string_type ()> escaped = qi::char_ (" %" ) > qi::repeat (2 )[qi::xdigit];
89
+ qi::rule<iterator, string_type::value_type ()> gen_delims = qi::char_ (" :/?#[]@" );
90
+ qi::rule<iterator, string_type::value_type ()> sub_delims = qi::char_ (" !$&'()*+,;=" );
92
91
92
+ qi::rule<iterator, string_type::value_type ()> reserved = gen_delims | sub_delims;
93
+ qi::rule<iterator, string_type::value_type ()> unreserved = qi::alnum | qi::char_ (" -._~" );
94
+ qi::rule<iterator, string_type ()> pct_encoded = qi::char_ (" %" ) > qi::repeat (2 )[qi::xdigit];
95
+
96
+ qi::rule<iterator, string_type ()> pchar = qi::raw[unreserved | pct_encoded | sub_delims | qi::char_ (" :@" )];
97
+
93
98
hostname<tags::http>::parser<iterator> hostname;
94
99
bool ok = qi::parse (
95
100
start_, end_,
@@ -101,9 +106,9 @@ namespace boost { namespace network { namespace uri {
101
106
]
102
107
>> hostname
103
108
>> -qi::lexeme[' :' >> qi::ushort_]
104
- >> - qi::lexeme[' / ' >> *(( qi::alnum | qi::punct) - ' ? ' ) ]
105
- >> -qi::lexeme[' ?' >> qi::raw[*(reserved | unreserved | escaped )]]
106
- >> -qi::lexeme[' #' >> qi::raw[*(reserved | unreserved | escaped )]]
109
+ >> qi::lexeme[qi::raw[*( qi::char_ ( " / " ) > *pchar)] ]
110
+ >> -qi::lexeme[' ?' >> qi::raw[*(pchar | qi::char_ ( " /? " ) )]]
111
+ >> -qi::lexeme[' #' >> qi::raw[*(pchar | qi::char_ ( " /? " ) )]]
107
112
),
108
113
result
109
114
);
0 commit comments