s3_website 2.14.2 → 2.14.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ec6e16da212e3d7ca9874580d8dd9be94860ad9
4
- data.tar.gz: 52622ca62f5343414315af55e456dbb4b03a2230
3
+ metadata.gz: 12868fe79f5723e84fb08c7e73d8349fedceb99e
4
+ data.tar.gz: 54a74071dc921c0427c42776bf0bfb103740b349
5
5
  SHA512:
6
- metadata.gz: 4aaf8cf3d256762c897c777f175c6f5e549ece335a0ed45005980c1676d6876a85f91d6dbf1d6b9e038bbd28e3bb846d8bb6e8d31afebcced7320805176df2d0
7
- data.tar.gz: 510fe2386587a3b07e08e9fb017c47a9a7abb01ddb2eccc51f0ba9c099b875ac451cc5e03291247e72d12998a35e85ebfcdba8acae67a2335f3991f1ee36522a
6
+ metadata.gz: d4ab32468213f00239e201c02bd0cf102e893576ca5772589b66fb0231225c2e0386b1c8251e4deed5c16f0aa4a1e1310fe11b2936b4d3b13e5306cc99a8b0c4
7
+ data.tar.gz: 4c95f59e5f2cf98e1481b136cd09109ec772cca2bd82bbdf7e2a3f8e5127478818e44bc36d098e41e039f84bfd36cc78016b606074e3546f7c255defd5b17d99
data/changelog.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  This project uses [Semantic Versioning](http://semver.org).
4
4
 
5
+ ## 2.14.3
6
+
7
+ Fix mime type of an already-gzipped .json file
8
+
9
+ See <https://github.com/laurilehmijoki/s3_website/pull/231>
10
+
5
11
  ## 2.14.2
6
12
 
7
13
  * Apply correct mime type on already-gzipped files
@@ -1,3 +1,3 @@
1
1
  module S3Website
2
- VERSION = '2.14.2'
2
+ VERSION = '2.14.3'
3
3
  end
@@ -65,7 +65,7 @@ case class Upload(originalFile: File, uploadType: UploadType)(implicit site: Sit
65
65
  lazy val contentType: Try[String] = tika map { tika =>
66
66
  val file = // This file contains the data that the user should see after decoding the the transport protocol (HTTP) encoding (practically: after ungzipping)
67
67
  if (fileIsGzippedByExternalBuildTool) {
68
- val unzippedFile = createTempFile(originalFile.getName, "unzipped")
68
+ val unzippedFile = createTempFile("unzipped", originalFile.getName)
69
69
  unzippedFile.deleteOnExit()
70
70
  using(new GZIPInputStream(fis(originalFile))) { stream =>
71
71
  IOUtils.copy(stream, new FileOutputStream(unzippedFile))
@@ -70,6 +70,18 @@ class S3WebsiteSpec extends Specification {
70
70
  sentPutObjectRequest.getMetadata.getContentType must equalTo("text/html; charset=utf-8")
71
71
  }
72
72
 
73
+ "apply the correct mime type on an already gzipped .json file" in new BasicSetup {
74
+ val jsonString = """" {"json": true} """
75
+ val gzippedJson = gzip(jsonString.getBytes(StandardCharsets.UTF_8))
76
+ config = """
77
+ |gzip:
78
+ | - .json
79
+ """
80
+ setLocalFileWithContent("test.json", gzippedJson)
81
+ push()
82
+ sentPutObjectRequest.getMetadata.getContentType must equalTo("application/json; charset=utf-8")
83
+ }
84
+
73
85
  "not gzip the file if it's already gzipped" in new BasicSetup {
74
86
  config = "gzip: true"
75
87
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: s3_website
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.14.2
4
+ version: 2.14.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lauri Lehmijoki
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-04 00:00:00.000000000 Z
11
+ date: 2016-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor