|
|
|
@ -72,6 +72,8 @@ func (h timeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
// Verify if date headers are set, if not reject the request
|
|
|
|
|
|
|
|
|
|
if r.Header.Get("Authorization") != "" { |
|
|
|
|
if r.Header.Get("x-amz-date") == "" && r.Header.Get("Date") == "" { |
|
|
|
|
// there is no way to knowing if this is a valid request, could be a attack reject such clients
|
|
|
|
|
writeErrorResponse(w, r, RequestTimeTooSkewed, acceptsContentType, r.URL.Path) |
|
|
|
@ -89,6 +91,7 @@ func (h timeHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { |
|
|
|
|
writeErrorResponse(w, r, RequestTimeTooSkewed, acceptsContentType, r.URL.Path) |
|
|
|
|
return |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
h.handler.ServeHTTP(w, r) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|