Signature calculation has now moved out from being a package to
top-level as a layered mechanism.
In case of payload calculation with body, go-routines are initiated
to simultaneously write and calculate shasum. Errors are sent
over the writer so that the lower layer removes the temporary files
properly.
In case of make bucket, there is a chance of Transfer-Encoding is sent
where Content-Length is missing. This patch fixes the problem by
checking whether Transfer-Encoding: chunked is set along with
Content-Length.
Do not look for Content-Length in headers and try to convert them into
integer representations use ContentLength field from *http.Request*.
If Content-Length is understood to be as '-1' then treat it as an error
condition, since it could be a malformed body to crash the server.
Fixes#1011
Put() replies back with
- EntityTooLarge with > 5GB in single PUT operation
- EntityTooSmall with < 1B in single PUT operation
- IncompleteBody with ho Content-Length found in HTTP request header