Permalink
Browse files

Merge branch 'support/2.0.x' into develop

Conflicts:
	CREDITS.md
	core/src/main/scala/org/scalatra/CookieSupport.scala
	core/src/main/scala/org/scalatra/CoreDsl.scala
	core/src/main/scala/org/scalatra/ScalatraFilter.scala
	core/src/main/scala/org/scalatra/ScalatraServlet.scala
	core/src/test/scala/org/scalatra/CookieSupportTest.scala
  • Loading branch information...
rossabaker committed Apr 26, 2012
2 parents 449e10c + 7b940f7 commit 848170bfc2018ece0f322d316299d732837b041a
View
@@ -20,7 +20,7 @@
- [Robbie Clutton](http://blog.iclutton.com/)
- [Thibault Duplessis](http://ornicar.github.com/)
- [David Heidrich](http://github.com/BowlingX)
-- [David Hrycyszyn](http://headlondon.com/david-hrycyszyn/blog-posts)
+- [Dave Hrycyszyn](http://github.com/futurechimp)
- [Tuomas Kareinen](http://www.iki.fi/kareinen/)
- [Miso Korkiakoski](http://github.com/mwing)
- [Yusuke Kuoka](http://d.hatena.ne.jp/mumoshu/)
@@ -32,6 +32,8 @@
- [Ted Nyman](http://github.com/tnm)
- [Șeyi Ogunyẹ́mi](http://www.micrypt.com)
- [Stefan Ollinger](http://github.com/dozed)
+- [Erik Rozendaal](http://github.com/erikrozendaal)
+- [Kazuhiro Sera](http://github.com/seratch)
- [Srirangan](http://srirangan.net)
- [Eric Torreborre](http://etorreborre.blogspot.com/)
- [Lucas Torri](http://github.com/lucastorri)
@@ -58,7 +58,7 @@ trait CoreDsl extends Handler with Control {
}
@deprecated("Use status_=(Int) instead", "2.1.0")
- def status(code: Int) = status_=(code)
+ def status(code: Int) { status_=(code) }
/**
* Sets the status code of the current response.
@@ -103,7 +103,7 @@ trait CoreDsl extends Handler with Control {
def after(transformers: RouteTransformer*)(block: => Any): Unit
@deprecated("Use after() { ... }", "2.0.0")
- final def afterAll(block: => Any): Unit = after()(block)
+ final def afterAll(block: => Any) { after()(block) }
@deprecated("Use after(RouteTransformer*) { ... }", "2.0.0")
final def afterSome(transformers: RouteTransformer*)(block: => Any) {
@@ -58,9 +58,10 @@ class CookieSupportTest extends ScalatraFunSuite {
}
}
- test("POST /setcookie with a value should return OK") {
+ test("POST /setcookie with a value should return the value") {
post("/foo/setcookie", "cookieval" -> "The value") {
- response.getHeader("Set-Cookie") must startWith ("""somecookie="The value";""")
+ val cookie = HttpCookie.parse(response.getHeader("Set-Cookie")).get(0)
+ cookie.getValue must be ("The value")
}
}
@@ -83,6 +84,13 @@ class CookieSupportTest extends ScalatraFunSuite {
}
}
+ test("POST /set-http-only-cookie should set the HttpOnly flag of the cookie") {
+ post("/foo/set-http-only-cookie", "cookieval" -> "whatever") {
+ val cookie = HttpCookie.parse(response.getHeader("Set-Cookie")).get(0)
+ cookie.isHttpOnly must be (true)
+ }
+ }
+
test("cookie path defaults to context path") {
post("/foo/setcookie", "cookieval" -> "whatever") {
response.getHeader("Set-Cookie") must include (";Path=/foo")

0 comments on commit 848170b

Please sign in to comment.