Skip to content

Commit 898967d

Browse files
Support non-US-ASCII dirs when using max_age
1 parent 6274b08 commit 898967d

File tree

4 files changed

+19
-2
lines changed

4 files changed

+19
-2
lines changed

changelog.md

+6
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
This project uses [Semantic Versioning](http://semver.org).
44

5+
## 2.1.15
6+
7+
* Support non-US-ASCII files when using `max_age`
8+
9+
Fixes https://github.com/laurilehmijoki/s3_website/issues/102
10+
511
## 2.1.14
612

713
* Fix https://github.com/laurilehmijoki/s3_website/issues/104

lib/s3_website/version.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module S3Website
2-
VERSION = '2.1.14'
2+
VERSION = '2.1.15'
33
end

src/main/scala/s3/website/model/push.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,9 @@ case class Upload(originalFile: File, uploadType: UploadType)(implicit site: Sit
8181
(seconds: Int) => Some(seconds),
8282
(globs: GlobsSeq) =>
8383
globs.find { globAndInt =>
84-
(rubyRuntime evalScriptlet s"File.fnmatch('${globAndInt._1}', '$s3Key')")
84+
(rubyRuntime evalScriptlet
85+
s"""|# encoding: utf-8
86+
|File.fnmatch('${globAndInt._1}', '$s3Key')""".stripMargin)
8587
.toJava(classOf[Boolean])
8688
.asInstanceOf[Boolean]
8789
} map (_._2)

src/test/scala/s3/website/S3WebsiteSpec.scala

+9
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,15 @@ class S3WebsiteSpec extends Specification {
400400
push
401401
sentPutObjectRequest.getMetadata.getCacheControl must equalTo("no-cache; max-age=0")
402402
}
403+
404+
"support non-US-ASCII directory names" in new AllInSameDirectory with EmptySite with MockAWS with DefaultRunMode {
405+
config = """
406+
|max_age:
407+
| "*": 21600
408+
""".stripMargin
409+
setLocalFile("tags/笔记/index.html")
410+
push must equalTo(0)
411+
}
403412
}
404413

405414
"max-age in config" should {

0 commit comments

Comments
 (0)