Parsing empty query parameters #499

Closed
FranciscoMoya opened this Issue Feb 27, 2015 · 4 comments

Comments

Projects
None yet
4 participants
@FranciscoMoya

Please, consider applying the following patch to allow empty values in a key/value query string. There are many situations in which they can occur.

Regards,
F. Moya

diff --git a/boost/network/uri/accessors.hpp b/boost/network/uri/accessors.hpp
index c050458..5248b34 100644
--- a/boost/network/uri/accessors.hpp
+++ b/boost/network/uri/accessors.hpp
@@ -27,7 +27,7 @@ struct key_value_sequence : spirit::qi::grammar {
     pair = key >> -('=' >> value);
     key =
         spirit::qi::char_("a-zA-Z_") >> *spirit::qi::char_("-+.~a-zA-Z_0-9/%");
-    value = +spirit::qi::char_("-+.~a-zA-Z_0-9/%");
+    value = *spirit::qi::char_("-+.~a-zA-Z_0-9/%");
   }
 
   spirit::qi::rule query;
@leecoder

This comment has been minimized.

Show comment
Hide comment

leecoder commented Apr 3, 2015

+1

@glynos

This comment has been minimized.

Show comment
Hide comment
@glynos

glynos Apr 3, 2015

Member

Sorry for the slow response.

Instead of requesting a patch, could you make a pull request instead? It
will be much easier for us to track. Additional unit tests covering this
scenario would also be appreciated.

Regards,
Glyn

On 3 April 2015 at 08:47, leecoder notifications@github.com wrote:

+1


Reply to this email directly or view it on GitHub
#499 (comment)
.

Member

glynos commented Apr 3, 2015

Sorry for the slow response.

Instead of requesting a patch, could you make a pull request instead? It
will be much easier for us to track. Additional unit tests covering this
scenario would also be appreciated.

Regards,
Glyn

On 3 April 2015 at 08:47, leecoder notifications@github.com wrote:

+1


Reply to this email directly or view it on GitHub
#499 (comment)
.

@deanberris

This comment has been minimized.

Show comment
Hide comment
@deanberris

deanberris Apr 7, 2015

Member

I echo @glynos here. Please add a pull request so that we can attribute the fix appropriately. If @FranciscoMoya can do it, I'd love to merge it. If not, @leecoder do you mind making that pull request?

Member

deanberris commented Apr 7, 2015

I echo @glynos here. Please add a pull request so that we can attribute the fix appropriately. If @FranciscoMoya can do it, I'd love to merge it. If not, @leecoder do you mind making that pull request?

leecoder added a commit to leecoder/cpp-netlib that referenced this issue Apr 13, 2015

@leecoder

This comment has been minimized.

Show comment
Hide comment
@leecoder

leecoder Apr 13, 2015

Ok~ I'll take it.
This reply was late because I've moved to new office in Tokyo.

Ok~ I'll take it.
This reply was late because I've moved to new office in Tokyo.

leecoder added a commit to leecoder/cpp-netlib that referenced this issue Apr 14, 2015

leecoder added a commit to leecoder/cpp-netlib that referenced this issue Apr 14, 2015

deanberris added a commit that referenced this issue Apr 20, 2015

Merge pull request #519 from leecoder/0.11-devel
Fix #499 - Parsing empty query parameters

@deanberris deanberris closed this Sep 11, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment