sftp: cap what the test filer reads from an upload

An upload that wrongly carries a large hole now fails the test instead of
filling memory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Chris LuandClaude Opus 5.5 committed 2026-12-04 01:31:43 -08:00
1 parent 1570202788
commit ff9102bc2a
1 file changed
+1 -1
+1 -1
View File
@@ -60,7 +60,7 @@ func newRWTest(t *testing.T, perms ...string) *rwTest {
fs.user.Permissions = map[string][]string{"/buckets": perms}
rw := &rwTest{fs: fs, fake: fake}
ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
body, _ := io.ReadAll(r.Body)
body, _ := io.ReadAll(io.LimitReader(r.Body, 1<<20))
rw.mu.Lock()
rw.bodies = append(rw.bodies, string(body))
rw.mu.Unlock()