Skip to content

Commit

Permalink
Test mime type of already-gzipped .json files
Browse files Browse the repository at this point in the history
  • Loading branch information
laurilehmijoki committed Aug 6, 2016
1 parent 50433de commit e9665e9
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/test/scala/s3/website/S3WebsiteSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,18 @@ class S3WebsiteSpec extends Specification {
sentPutObjectRequest.getMetadata.getContentType must equalTo("text/html; charset=utf-8")
}

"apply the correct mime type on an already gzipped .json file" in new BasicSetup {
val jsonString = """" {"json": true} """
val gzippedJson = gzip(jsonString.getBytes(StandardCharsets.UTF_8))
config = """
|gzip:
| - .json
"""
setLocalFileWithContent("test.json", gzippedJson)
push()
sentPutObjectRequest.getMetadata.getContentType must equalTo("application/json; charset=utf-8")
}

"not gzip the file if it's already gzipped" in new BasicSetup {
config = "gzip: true"

Expand Down

0 comments on commit e9665e9

Please sign in to comment.