Hi,

While I tried to work on akka/akka-http#276 
<https://github.com/akka/akka-http/issues/276>, and looked at 
akka/akka#18479 <https://github.com/akka/akka/pull/18715> (PR to fix #18479 
= akka/akka#18715 <https://github.com/akka/akka/pull/18715>), 
I found that the following code:

Query("GROUP=10380?page=2",mode = Uri.ParsingMode.Relaxed)


throws an exception:

  IllegalUriException: Illegal query: Invalid input '=', expected '+', 
query-char, 'EOI', '&' or pct-encoded (line 1, column 17): GROUP=10380?page=


Wasn't akka/akka#18479 <https://github.com/akka/akka/pull/18715> (PR=
akka/akka#18715 <https://github.com/akka/akka/pull/18715>) intended to make 
this a valid query string, with Uri.ParsingMode.Relaxed ?


*Additional Info*
1. I looked for a test case for this.
According to UriSpec.scala 
<https://github.com/akka/akka-http/blob/b7f13dc36918c870662e5434b15a45ab94594c8e/akka-http-core/src/test/scala/akka/http/scaladsl/model/UriSpec.scala#L508L514>,
 
Uri("?a=b=c").query() is still invalid, although query() method has default 
mode = Uri.ParsingMode.Relaxed.


2. I didn't fully understand how parsing works .... but probably it's 
because CharacterClases.scala 
<https://github.com/akka/akka-http/blob/b7f13dc36918c870662e5434b15a45ab94594c8e/akka-http-core/src/main/scala/akka/http/impl/model/parser/CharacterClasses.scala#L51>
defines:

  val `relaxed-query-char` = VCHAR -- "%&=#"

where ('=') is made invalid?

UriParser has 

private[this] val `query-char` = uriParsingMode match {
  case Uri.ParsingMode.Strict              ⇒ `strict-query-char`
  case Uri.ParsingMode.Relaxed             ⇒ `relaxed-query-char`
}

where `relaxed-query-char` is defined as above.

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