Skip to content

Commit

Permalink
format mod date in utc
Browse files Browse the repository at this point in the history
  • Loading branch information
milankonir committed Jan 11, 2024
1 parent 1ce26e1 commit df13d57
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ build:
go build

test:
TZ=Europe/London go test -race ./...
go test -race ./...

fmt:
@gofmt -l -w $(SRC)
Expand Down
2 changes: 1 addition & 1 deletion encode.go
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ func (p *Part) setupMIMEHeaders() transferEncoding {
param := make(map[string]string)
setParamValue(param, hpFilename, fileName)
if !p.FileModDate.IsZero() {
setParamValue(param, hpModDate, p.FileModDate.Format(time.RFC822))
setParamValue(param, hpModDate, p.FileModDate.UTC().Format(time.RFC822))
}
if mt := mime.FormatMediaType(p.Disposition, param); mt != "" {
p.Disposition = mt
Expand Down
2 changes: 1 addition & 1 deletion testdata/encode/part-default-headers.golden
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Content-Disposition: attachment; filename=stuff.zip; modification-date="01
Feb 03 04:05 GMT"
Feb 03 04:05 UTC"
Content-Id: <mycontentid>
Content-Transfer-Encoding: base64
Content-Type: application/zip; boundary=enmime-abcdefg0123456789;
Expand Down
2 changes: 1 addition & 1 deletion testdata/encode/part-file-mod-date.golden
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Content-Disposition: inline; modification-date="01 Feb 03 04:05 GMT"
Content-Disposition: inline; modification-date="01 Feb 03 04:05 UTC"
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=utf-8

Expand Down
2 changes: 1 addition & 1 deletion testdata/encode/part-quoted-headers.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Content-Disposition: attachment;
filename="=?utf-8?b?w6FydsOtenTFsXLFkSAieCIgdMO8a8O2cmbDunLDs2fDqXAuemlw?=";
modification-date="01 Feb 03 04:05 GMT"
modification-date="01 Feb 03 04:05 UTC"
Content-Id: <mycontentid>
Content-Transfer-Encoding: base64
Content-Type: application/zip; boundary=enmime-abcdefg0123456789;
Expand Down
2 changes: 1 addition & 1 deletion testdata/encode/part-quoted-printable-headers.golden
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Content-Disposition: attachment;
filename="=?utf-8?b?w6FydsOtenTFsXLFkSAieCIgdMO8a8O2cmbDunLDs2fDqXAuemlw?=";
modification-date="01 Feb 03 04:05 GMT"
modification-date="01 Feb 03 04:05 UTC"
Content-Id: <mycontentid>
Content-Transfer-Encoding: base64
Content-Type: application/zip; boundary=enmime-abcdefg0123456789;
Expand Down

0 comments on commit df13d57

Please sign in to comment.