History

Check for value > 7 days in X-Amz-Expires header. (#5163)

Add a check to see if the X-Amz-Expires header in the presigned URL is less than 7 days. Fixes #5162

kannappanr committed 9 years ago

Commit f460ece1 parent d1067983 files · +35 −0Browse files

Showing the changes to cmd/api-errors.go (1 of 3 files). Show all

Unified · Split

cmd/api-errors.go+6−0
@@ -120,6 +120,7 @@ const ( · 119 unmodified lines
120120 ErrBucketAlreadyExists
121121 ErrMetadataTooLarge
122122 ErrUnsupportedMetadata
123+ ErrMaximumExpires
123124 // Add new error codes here.
124125
125126 // Server-Side-Encryption (with Customer provided key) related API errors.
@@ -725,6 +726,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 599 unmodified lines
725726 Description: errObjectTampered.Error(),
726727 HTTPStatusCode: http.StatusPartialContent,
727728 },
729+ ErrMaximumExpires: {
730+ Code: "AuthorizationQueryParametersError",
731+ Description: "X-Amz-Expires must be less than a week (in seconds); that is, the given X-Amz-Expires must be less than 604800 seconds",
732+ HTTPStatusCode: http.StatusBadRequest,
733+ },
728734 // Add your error structure here.
729735 }
730736

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t