Hi,

While I was trying to work on akka/akka-http#276 
<https://github.com/akka/akka-http/issues/276>, I noticed something strange.

After akka/akka#18479 <https://github.com/akka/akka/pull/18479> was fixed 
(PR to fix #18479 = akka/akka#18715 
<https://github.com/akka/akka/pull/18715>), now the following is possible.
Isn't it non-intuitive that you can specify Uri.ParsingMode twice - once in 
Uri() and secondly in query() method?


val uri = Uri("http://localhost?a^=b";, mode=Uri.ParsingMode.Relaxed)

//prints Some(b)
println(uri.query(mode=Uri.ParsingMode.Relaxed).get("a^"))

//IllegalUriException: Illegal query: Invalid input '^',
// expected '+', '=', query-char, 'EOI', '&' or pct-encoded
// (line 1, column 2): a^=b
println(uri.query(mode=Uri.ParsingMode.Strict).get("a^"))




If parsing a query string should be deferred as in akka/akka#18479 
<https://github.com/akka/akka/pull/18479>, should we not pass mode as well as 
charset into akka.http.scaladsl.model.Uri companion object's apply() methods?

Thanks,
Richard



-- 
>>>>>>>>>>      Read the docs: http://akka.io/docs/
>>>>>>>>>>      Check the FAQ: 
>>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html
>>>>>>>>>>      Search the archives: https://groups.google.com/group/akka-user
--- 
You received this message because you are subscribed to the Google Groups "Akka 
User List" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/akka-user.
For more options, visit https://groups.google.com/d/optout.

Reply via email to