mirror of
https://github.com/minio/minio.git
synced 2025-11-07 12:52:58 -05:00
Refactor streaming signatureV4 w/ state machine (#2862)
* Refactor streaming signatureV4 w/ state machine - Used state machine to make transitions between reading chunk header, chunk data and trailer explicit. * debug: add print/panic statements to gather more info on CI failure * Persist lastChunk status between Read() on ChunkReader ... remove panic() which was added as interim aid for debugging. * Add unit-tests to cover v4 streaming signature
This commit is contained in:
committed by
Harshavardhana
parent
3cfb23750a
commit
2d5e988a6d
@@ -136,8 +136,8 @@ func TestParseS3ChunkExtension(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// Test check CRLF characters on input reader.
|
||||
func TestCheckCRLF(t *testing.T) {
|
||||
// Test read CRLF characters on input reader.
|
||||
func TestReadCRLF(t *testing.T) {
|
||||
type testCase struct {
|
||||
reader io.Reader
|
||||
expectedErr error
|
||||
@@ -153,7 +153,7 @@ func TestCheckCRLF(t *testing.T) {
|
||||
{bytes.NewReader([]byte("h")), io.ErrUnexpectedEOF},
|
||||
}
|
||||
for i, tt := range tests {
|
||||
err := checkCRLF(tt.reader)
|
||||
err := readCRLF(tt.reader)
|
||||
if err != tt.expectedErr {
|
||||
t.Errorf("Test %d: Expected %s, got %s this", i+1, tt.expectedErr, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user