From 1317ca8cd7fa8a0e98c082e01caac26b552ffa2e Mon Sep 17 00:00:00 2001 From: alandefreitas Date: Mon, 14 Feb 2022 20:48:12 -0300 Subject: [PATCH] handle brackets in key_chars --- include/boost/url/rfc/impl/query_rule.ipp | 2 +- test/unit/rfc/query_rule.cpp | 9 ++------- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/include/boost/url/rfc/impl/query_rule.ipp b/include/boost/url/rfc/impl/query_rule.ipp index 93982ad7..4aaf2d06 100644 --- a/include/boost/url/rfc/impl/query_rule.ipp +++ b/include/boost/url/rfc/impl/query_rule.ipp @@ -27,7 +27,7 @@ struct query_rule::key_chars key_chars() noexcept : grammar::lut_chars( pchars - + '/' + '?' + + '/' + '?' + '[' + ']' - '&' - '=') { } diff --git a/test/unit/rfc/query_rule.cpp b/test/unit/rfc/query_rule.cpp index 8834dce1..8f1546cc 100644 --- a/test/unit/rfc/query_rule.cpp +++ b/test/unit/rfc/query_rule.cpp @@ -82,15 +82,10 @@ public: good("x=y&"); good("x=y&a"); good("x=y&a=b&"); + good("keys[]=value1&keys[]=value2"); // some gen-delims - for(auto c : - "#[]" - ) - { - string_view s( &c, 1 ); - bad(s); - } + bad("#"); // pchar / "/" / "?" good(