You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I create a PUT request, where I incorrectly specify a Content-Length header value LESS than the size of the payload, SDK will actually send the entire payload.
+-------------------------------------------------+
| 0 1 2 3 4 5 6 7 8 9 a b c d e f |
+--------+-------------------------------------------------+----------------+
|00000000| 61 62 63 64 |abcd |
+--------+-------------------------------------------------+----------------+
If I GET the object, it will correctly be of size 1, containing just the character "a". The problem is that if the connection stays open, S3 will keep the remaining "bcd" characters in its buffer. So if I issue a second PUT request (or any request, really), and my previous connection is reused (which it should be), then the "bcd" will be the prefix of whatever headers are sent, which of course is invalid and results in a 400 Bad Request.
Uh oh!
There was an error while loading. Please reload this page.
If I create a PUT request, where I incorrectly specify a Content-Length header value LESS than the size of the payload, SDK will actually send the entire payload.
The SDK sends the header:
Followed by the body:
Which results in a 200 Success:
If I GET the object, it will correctly be of size 1, containing just the character "a". The problem is that if the connection stays open, S3 will keep the remaining "bcd" characters in its buffer. So if I issue a second PUT request (or any request, really), and my previous connection is reused (which it should be), then the "bcd" will be the prefix of whatever headers are sent, which of course is invalid and results in a 400 Bad Request.
Full code:
The text was updated successfully, but these errors were encountered: