Verify if request date is 5minutes late, reject such a request as

it could be a possible replay attack.

This commit also fixes #505, by returning MethodNotAllowed instead of NotImplemented
This commit is contained in:
Harshavardhana
2015-04-27 03:54:49 -07:00
parent 1531802b73
commit ade803a923
5 changed files with 73 additions and 16 deletions
+1
View File
@@ -123,6 +123,7 @@ func setAuthHeader(req *http.Request) {
encoder.Write(hm.Sum(nil))
encoder.Close()
req.Header.Set("Authorization", authHeader.String())
req.Header.Set("Date", time.Now().UTC().Format(http.TimeFormat))
}
func (s *MySuite) TestNonExistantBucket(c *C) {