mirror of
https://github.com/minio/minio.git
synced 2025-11-09 05:34:56 -05:00
Require content-length in POST & Upload requests (#3671)
Avoid passing size = -1 to PutObject API by requiring content-length header in POST request (as AWS S3 does) and in Upload web handler. Post handler is modified to completely store multipart file to know its size before sending it to PutObject().
This commit is contained in:
committed by
Harshavardhana
parent
4b4cb07fb6
commit
ed4fcb63f7
@@ -106,13 +106,13 @@ func isAuthTokenValid(tokenString string) bool {
|
||||
}
|
||||
|
||||
func isHTTPRequestValid(req *http.Request) bool {
|
||||
return webReqestAuthenticate(req) == nil
|
||||
return webRequestAuthenticate(req) == nil
|
||||
}
|
||||
|
||||
// Check if the request is authenticated.
|
||||
// Returns nil if the request is authenticated. errNoAuthToken if token missing.
|
||||
// Returns errAuthentication for all other errors.
|
||||
func webReqestAuthenticate(req *http.Request) error {
|
||||
func webRequestAuthenticate(req *http.Request) error {
|
||||
jwtToken, err := jwtreq.ParseFromRequest(req, jwtreq.AuthorizationHeaderExtractor, keyFuncCallback)
|
||||
if err != nil {
|
||||
if err == jwtreq.ErrNoTokenInRequest {
|
||||
|
||||
Reference in New Issue
Block a user