test: REST CORS - initial tests

This commit is contained in:
Luke McCrone
2026-02-19 20:19:05 -03:00
parent a81f9e5152
commit 5fc7357a03
12 changed files with 500 additions and 16 deletions
@@ -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
}