Should uri_string:dissect_query/1 be able to parse this?

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Should uri_string:dissect_query/1 be able to parse this?

Leo Liu-2
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
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Should uri_string:dissect_query/1 be able to parse this?

Marc Worrell
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 <[hidden email]> 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
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Should uri_string:dissect_query/1 be able to parse this?

Loïc Hoguin-3
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 <[hidden email]> 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
>> [hidden email]
>> http://erlang.org/mailman/listinfo/erlang-questions
>
> _______________________________________________
> erlang-questions mailing list
> [hidden email]
> http://erlang.org/mailman/listinfo/erlang-questions
>

--
Loïc Hoguin
https://ninenines.eu
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Should uri_string:dissect_query/1 be able to parse this?

Peter Dimitrov
In reply to this post by Leo Liu-2
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:
[hidden email] <[hidden email]> On Behalf Of Loïc Hoguin
Sent: den 10 maj 2019 10:00
To: Marc Worrell <[hidden email]>; Leo Liu <[hidden email]>
Cc: [hidden email]
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 <[hidden email]> 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

>> [hidden email]

>> 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

> [hidden email]

> 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

[hidden email]

https://protect2.fireeye.com/url?k=e5ae9822-b9273749-e5aed8b9-0cc47ad93ea2-efb6eef7993037ae&u=http://erlang.org/mailman/listinfo/erlang-questions    

_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Should uri_string:dissect_query/1 be able to parse this?

Leo Liu-2
On 2019-05-10 15:26 +0200, Peter Dimitrov wrote:
> 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

Thanks. That is great news. Is there a plan to fix it in OTP 21?

Leo
_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions
Reply | Threaded
Open this post in threaded view
|

Re: Should uri_string:dissect_query/1 be able to parse this?

Peter Dimitrov
In reply to this post by Leo Liu-2

Hi,


There are no such plans at the moment due to the coming release of OTP-22.


BR/Peter


-----Original Message-----
From: Leo Liu <
[hidden email]>
Sent: den 10 maj 2019 18:24
To: Peter Dimitrov <[hidden email]>
Cc: Loïc Hoguin <[hidden email]>; Marc Worrell <[hidden email]>; [hidden email]
Subject: Re: Should uri_string:dissect_query/1 be able to parse this?

 

On 2019-05-10 15:26 +0200, Peter Dimitrov wrote:

> 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

 

Thanks. That is great news. Is there a plan to fix it in OTP 21?

 

Leo


_______________________________________________
erlang-questions mailing list
[hidden email]
http://erlang.org/mailman/listinfo/erlang-questions