Skip to content

Instantly share code, notes, and snippets.

@oyvindio
Created September 28, 2014 15:51
Show Gist options
  • Save oyvindio/3cc7bd666a23288dc45f to your computer and use it in GitHub Desktop.
Save oyvindio/3cc7bd666a23288dc45f to your computer and use it in GitHub Desktop.
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