You are viewing a plain text version of this content. The canonical link for it is here.
Posted to hdfs-dev@hadoop.apache.org by "Elek, Marton (JIRA)" <ji...@apache.org> on 2018/11/08 08:38:00 UTC

[jira] [Created] (HDDS-820) Use more strict data format for the Last-Modified headers of s3 gateway

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 rfc-822)

From https://tools.ietf.org/html/rfc1123

{code}
   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
{code}

From https://tools.ietf.org/html/rfc822
{code}
 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.
{code}

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

{code}
	RFC1123     = "Mon, 02 Jan 2006 15:04:05 MST"
{code}

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
(v7.6.3#76005)

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