[2.1-SNAPSHOT scala] Replacement of "+" character to the space in a request parameter. Bug?

127 views
Skip to first unread message

Anatoly Vinogradov

unread,
May 4, 2012, 4:49:01 AM5/4/12
to play-fr...@googlegroups.com
Have an error: 
...
Internal server error, for request [GET /connection?connection_id=IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU+KgE=]
...
Caused by: java.net.URISyntaxException: Illegal character in query at index 78: http://localhost:9009/set?cid=IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU KgE=
...

Exception throws here:

 def connection(connectionId: String) = Action {
   Async {
      WS.url("http://localhost:9009/set?cid=" + connectionId).get().map { response =>
        Ok(response)
      }
   }        
 }

Value of the parameter "connectionId" in the function "connection" is "IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU KgE=" instead of "IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU+KgE=". That is a "+" is replaced by space.

Julien Tournay

unread,
May 4, 2012, 1:49:16 PM5/4/12
to play-fr...@googlegroups.com
Hi,

You should use: WS.url("http://localhost:9009/set").withQueryString("cid" -> connectionId) 

jto.

Anatoly Vinogradov

unread,
May 4, 2012, 2:15:32 PM5/4/12
to play-fr...@googlegroups.com
Thanks but it does not solve the issue. 
Value of the parameter "connectionId" in the function "connection" is "IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU KgE=" instead of "IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU+KgE=". That is a "+" is replaced by space.
I think this is a bug.

2012/5/4 Julien Tournay <boud...@gmail.com>

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/om9ZCr6GXsUJ.

To post to this group, send email to play-fr...@googlegroups.com.
To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.



--
С уважением,
  Анатолий Виноградов.

Patrick Cavanaugh

unread,
May 6, 2012, 9:39:34 AM5/6/12
to play-fr...@googlegroups.com
"+" in query string parameters should be escaped as %2B, otherwise it will be interpreted as a space. Try it here and you'll see: http://meyerweb.com/eric/tools/dencoder/

You should use the appropriate encoding function wherever the connectionId parameter is being generated to begin with.


On Friday, May 4, 2012 2:15:32 PM UTC-4, Anatoly Vinogradov wrote:
Thanks but it does not solve the issue. 
Value of the parameter "connectionId" in the function "connection" is "IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU KgE=" instead of "IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU+KgE=". That is a "+" is replaced by space.
I think this is a bug.

2012/5/4 Julien Tournay <boud...@gmail.com>
Hi,

You should use: WS.url("http://localhost:9009/set").withQueryString("cid" -> connectionId) 

jto.

Le vendredi 4 mai 2012 01:49:01 UTC-7, Anatoly Vinogradov a écrit :
Have an error: 
...
Internal server error, for request [GET /connection?connection_id=IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU+KgE=]
...
Caused by: java.net.URISyntaxException: Illegal character in query at index 78: http://localhost:9009/set?cid=IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU KgE=
...

Exception throws here:

 def connection(connectionId: String) = Action {
   Async {
      WS.url("http://localhost:9009/set?cid=" + connectionId).get().map { response =>
        Ok(response)
      }
   }        
 }

Value of the parameter "connectionId" in the function "connection" is "IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU KgE=" instead of "IjtSSEMkaC9QFRZSV01kUygPVxMubVMLMw5KVVIGKUcCQlU+KgE=". That is a "+" is replaced by space.

--
You received this message because you are subscribed to the Google Groups "play-framework" group.
To view this discussion on the web visit https://groups.google.com/d/msg/play-framework/-/om9ZCr6GXsUJ.

To post to this group, send email to play-framework@googlegroups.com.
To unsubscribe from this group, send email to play-framework+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
Reply all
Reply to author
Forward
0 new messages