Merge pull request #1496 from pulumi/zip-dates
Use an even more reasonable modtime in ZIP entries
This commit is contained in:
commit
1b33dbea53
1 changed files with 5 additions and 3 deletions
|
@ -959,10 +959,12 @@ func addNextFileToZIP(r ArchiveReader, zw *zip.Writer) error {
|
||||||
Method: zip.Deflate,
|
Method: zip.Deflate,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set a nonzero -- but constant -- modification time. Otherwise, some agents (e.g. Azure websites) can't extract the
|
// Set a nonzero -- but constant -- modification time. Otherwise, some agents (e.g. Azure
|
||||||
// resulting archive. We use `SetModTime` for go1.9 compatibility.
|
// websites) can't extract the resulting archive. The date is comfortably after 1980 because
|
||||||
|
// the ZIP format includes a date representation that starts at 1980. Use `SetModTime` to
|
||||||
|
// remain compatible with Go 1.9.
|
||||||
// nolint: megacheck
|
// nolint: megacheck
|
||||||
fh.SetModTime(time.Unix(0, 0))
|
fh.SetModTime(time.Date(1990, time.January, 1, 0, 0, 0, 0, time.UTC))
|
||||||
|
|
||||||
fw, err := zw.CreateHeader(fh)
|
fw, err := zw.CreateHeader(fh)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue