Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
routeParams are now properly urldecoded, fixes #68
- Loading branch information
Julio Capote
committed
Jan 10, 2014
1 parent
5cf334f
commit 86ff2d2
Showing
2 changed files
with
30 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.twitter.finatra | ||
|
||
import com.twitter.finatra.test.{FlatSpecHelper, SpecHelper} | ||
|
||
class RouteParamsSpec extends FlatSpecHelper { | ||
|
||
class ExampleApp extends Controller { | ||
get("/:foo") { request => | ||
val decoded = request.routeParams.get("foo").get | ||
render.plain(decoded).toFuture | ||
} | ||
} | ||
|
||
val server = new FinatraServer | ||
server.register(new ExampleApp) | ||
|
||
"Response" should "contain decoded params" in { | ||
get("/hello%3Aworld") | ||
response.body should equal("hello:world") | ||
} | ||
|
||
|
||
} |