Google Groups

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


Anatoly Vinogradov May 4, 2012 1:49 AM
Posted in group: play-framework
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.