api: Implement support for additional request headers.

Now GetObject and HeadObject both support

  - If-Modified-Since, If-Unmodified-Since
  - If-Match, If-None-Match

request headers.

These headers are used to further handle the responses for GetObject
and HeadObject API.

Fixes #1098
This commit is contained in:
Harshavardhana
2016-02-28 18:10:37 -08:00
parent 0b2e449727
commit ee1b86e517
4 changed files with 153 additions and 8 deletions

View File

@@ -76,7 +76,7 @@ func setObjectHeaders(w http.ResponseWriter, metadata fs.ObjectMetadata, content
setCommonHeaders(w)
}
// set object headers
lastModified := metadata.LastModified.Format(http.TimeFormat)
lastModified := metadata.LastModified.UTC().Format(http.TimeFormat)
// object related headers
w.Header().Set("Content-Type", metadata.ContentType)
if metadata.MD5 != "" {