hadoop-hdfs-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Elek, Marton (JIRA)" <j...@apache.org>
Subject [jira] [Created] (HDDS-820) Use more strict data format for the Last-Modified headers of s3 gateway
Date Thu, 08 Nov 2018 08:38:00 GMT
Elek, Marton created HDDS-820:

             Summary: Use more strict data format for the Last-Modified headers of s3 gateway
                 Key: HDDS-820
                 URL: https://issues.apache.org/jira/browse/HDDS-820
             Project: Hadoop Distributed Data Store
          Issue Type: Sub-task
          Components: S3
            Reporter: Elek, Marton
            Assignee: Elek, Marton
             Fix For: 0.4.0

The format of HTTP Last-Modified header is defined by rfc-1123 (which updates the earlier

>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
          The character "*" preceding an element indicates repetition.
     The full form is:
     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.

This message was sent by Atlassian JIRA

To unsubscribe, e-mail: hdfs-dev-unsubscribe@hadoop.apache.org
For additional commands, e-mail: hdfs-dev-help@hadoop.apache.org

View raw message