api: Handle content-length-range policy properly. (#3297)

content-length-range policy in postPolicy API was
not working properly handle it. The reflection
strategy used has changed in recent version of Go.
Any free form interface{} of any integer is treated
as `float64` this caused a bug where content-length-range
parsing failed to provide any value.

Fixes #3295
This commit is contained in:
Harshavardhana
2016-11-21 04:15:26 -08:00
committed by GitHub
parent 5197649081
commit aa98702908
6 changed files with 143 additions and 31 deletions

View File

@@ -629,6 +629,8 @@ func toAPIErrorCode(err error) (apiErr APIErrorCode) {
apiErr = ErrContentSHA256Mismatch
case ObjectTooLarge:
apiErr = ErrEntityTooLarge
case ObjectTooSmall:
apiErr = ErrEntityTooSmall
default:
apiErr = ErrInternalError
}