s3_website 2.14.2 → 2.14.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/changelog.md +6 -0
- data/lib/s3_website/version.rb +1 -1
- data/src/main/scala/s3/website/model/push.scala +1 -1
- data/src/test/scala/s3/website/S3WebsiteSpec.scala +12 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12868fe79f5723e84fb08c7e73d8349fedceb99e
|
4
|
+
data.tar.gz: 54a74071dc921c0427c42776bf0bfb103740b349
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/s3_website/version.rb
CHANGED
@@ -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
|
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.
|
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-
|
11
|
+
date: 2016-08-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|