mirror of
https://github.com/versity/versitygw.git
synced 2026-08-20 06:06:19 +00:00
test: REST CORS - initial tests
This commit is contained in:
@@ -2,6 +2,7 @@ package command
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"io"
|
||||
"os"
|
||||
)
|
||||
|
||||
@@ -46,6 +47,9 @@ func (w *WholePayload) WritePayload(filePath string) error {
|
||||
var bytesRead int
|
||||
bytesRead, err = sourceFile.Read(buffer)
|
||||
if err != nil {
|
||||
if err == io.EOF {
|
||||
break
|
||||
}
|
||||
return fmt.Errorf("error reading data bytes: %w", err)
|
||||
}
|
||||
if bytesRead == 0 {
|
||||
@@ -55,5 +59,8 @@ func (w *WholePayload) WritePayload(filePath string) error {
|
||||
return fmt.Errorf("error writing bytes to file: %w", err)
|
||||
}
|
||||
}
|
||||
if err := outFile.Close(); err != nil {
|
||||
return fmt.Errorf("error closing output file: %w", err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user