Description
The format of HTTP Last-Modified header is defined by rfc-1123 (which updates the earlier rfc-822)
From https://tools.ietf.org/html/rfc1123
5.2.14 RFC-822 Date and Time Specification: RFC-822 Section 5
The syntax for the date is hereby changed to:
date = 1*2DIGIT month 2*4DIGIT
From https://tools.ietf.org/html/rfc822
2.4. *RULE: REPETITION The character "*" preceding an element indicates repetition. The full form is: <l>*<m>element indicating at least <l> and at most <m> occurrences of element. Default values are 0 and infinity so that "*(element)" allows any number, including zero; "1*element" requires at least one; and "1*2element" allows one or two.
It means that both of the following dates are good:
- Wed, 07 Nov 2018 10:31:05 GMT (two digits day)
- Wed, 7 Nov 2018 10:31:05 GMT (one digits day)
Java implements it in the right way in DateTimeFormatter.RFC_1123_DATE_TIME, it sets the minimum and maximum size of the day field (1-2)
Golang follows a different way to define the date format, there is a fixed date which should be used as an example format which will be followed.
http.TimeFormat (in golang) defines the format of the HTTP date:
From https://golang.org/src/time/format.go
RFC1123 = "Mon, 02 Jan 2006 15:04:05 MST"
Base on this definition the day also should be two digits.
Summary: As rfc1123 allows the usage of both format I propose two use the two digit days all the time, to make it possible to use the s3g from golang.
Note: this is required as the CTrox/csi-s3 driver uses the golang base minio s3 client to create/get/list buckets before mounting it with fuse drivers.