[erlang-questions] Should uri_string:dissect_query/1 be able to parse this?

Peter Dimitrov peterdmv@REDACTED
Fri May 10 15:26:32 CEST 2019


Hi,

uri_string:dissect_query/1 is already fixed on master so it will be
available in OTP-22:

1> uri_string:dissect_query("b=12&a").
[{"b","12"},{"a",true}]
2>

BR/Peter

-----Original Message-----
From: erlang-questions-bounces@REDACTED
<erlang-questions-bounces@REDACTED> On Behalf Of Loïc Hoguin
Sent: den 10 maj 2019 10:00
To: Marc Worrell <marc@REDACTED>; Leo Liu <sdl.web@REDACTED>
Cc: erlang-questions@REDACTED
Subject: Re: [erlang-questions] Should uri_string:dissect_query/1 be able
to parse this?



Not just common, it's not an error. The parsing code must be
https://url.spec.whatwg.org/#urlencoded-parsing to be correct.



On 10/05/2019 09:50, Marc Worrell wrote:

> A query argument without a ‘=‘ is something you see quite often.

> So in my opinion the uri_string module should be able to handle it.

>

> - Marc

>

>

>> On 10 May 2019, at 04:31, Leo Liu <sdl.web@REDACTED> wrote:

>>

>> uri_string is a solid module and great addition. I like using it

>> whenever possible. But,

>>

>>> uri_string:dissect_query("b=12&a").

>>   {error,missing_value,<<>>}

>>

>> whenever there is a key without a trailing =.

>>

>> Does it make more sense to be able to parse these query strings?

>>

>> _______________________________________________

>> erlang-questions mailing list

>> erlang-questions@REDACTED

>> https://protect2.fireeye.com/url?k=1a7128cd-46f887a6-1a716856-0cc47ad

>> 93ea2-f9a6a7cb2daffdbe&u=http://erlang.org/mailman/listinfo/erlang-qu

>> estions

>

> _______________________________________________

> erlang-questions mailing list

> erlang-questions@REDACTED

> https://protect2.fireeye.com/url?k=cb00f68b-978959e0-cb00b610-0cc47ad9

> 3ea2-579928f8286624c6&u=http://erlang.org/mailman/listinfo/erlang-ques

> tions

>



--

Loïc Hoguin

https://protect2.fireeye.com/url?k=e60bd0f8-ba827f93-e60b9063-0cc47ad93ea2-123d568d944cd0be&u=https://ninenines.eu/

_______________________________________________

erlang-questions mailing list

erlang-questions@REDACTED
https://protect2.fireeye.com/url?k=e5ae9822-b9273749-e5aed8b9-0cc47ad93ea2-efb6eef7993037ae&u=http://erlang.org/mailman/listinfo/erlang-questions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20190510/cec8ddb1/attachment.htm>


More information about the erlang-questions mailing list