mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-05 10:37:23 +01:00
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:
1 parent
1570202788
commit
ff9102bc2a
1 file changed
+1
-1
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user