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
120 ErrBucketAlreadyExists120 ErrBucketAlreadyExists
121 ErrMetadataTooLarge121 ErrMetadataTooLarge
122 ErrUnsupportedMetadata122 ErrUnsupportedMetadata
123 ErrMaximumExpires
123 // Add new error codes here.124 // Add new error codes here.
124 125
125 // Server-Side-Encryption (with Customer provided key) related API errors.126 // Server-Side-Encryption (with Customer provided key) related API errors.
@@ -725,6 +726,11 @@ var errorCodeResponse = map[APIErrorCode]APIError{ · 599 unmodified lines
725 Description: errObjectTampered.Error(),726 Description: errObjectTampered.Error(),
726 HTTPStatusCode: http.StatusPartialContent,727 HTTPStatusCode: http.StatusPartialContent,
727 },728 },
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 },
728 // Add your error structure here.734 // Add your error structure here.
729}735}
730 736

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