Created
September 28, 2014 15:51
-
-
Save oyvindio/3cc7bd666a23288dc45f to your computer and use it in GitHub Desktop.
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
diff --git a/core/src/test/scala/org/scalatra/ContentTypeTest.scala b/core/src/test/scala/org/scalatra/ContentTypeTest.scala | |
index 02ba9ff..2db116d 100644 | |
--- a/core/src/test/scala/org/scalatra/ContentTypeTest.scala | |
+++ b/core/src/test/scala/org/scalatra/ContentTypeTest.scala | |
@@ -24,6 +24,11 @@ class ContentTypeTestServlet(system: ActorSystem) extends ScalatraServlet { | |
"test" | |
} | |
+ get("/byte-array") { | |
+ contentType = "application/octet-stream" | |
+ Array[Byte]() | |
+ } | |
+ | |
get("/implicit/string") { | |
"test" | |
} | |
@@ -136,6 +141,17 @@ class ContentTypeTest extends ScalatraFunSuite with BeforeAndAfterAll { | |
} | |
} | |
+ test("contentType of binary data should not include charset parameter") { | |
+ get("/byte-array") { | |
+ response.getContentType should equal ("application/octet-stream") | |
+ } | |
+ } | |
+ | |
+ test("contentType of binary data should not include charset parameter when contentType is default") { | |
+ get("/implicit/byte-array") { | |
+ response.getContentType should equal ("application/octet-stream") | |
+ } | |
+ } | |
test("contentType is threadsafe") { | |
class RequestActor extends Actor { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment