This commit is contained in:
2026-10-03 12:27:20 +07:00
parent 14572d6562
commit 3cdcd12fee
4 changed files with 23 additions and 15 deletions
+9 -9
View File
@@ -103,7 +103,7 @@ func TestGatewayDownloadTeamQR(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
data, err := io.ReadAll(resp.Body)
if err != nil {
t.Fatal(err)
@@ -122,7 +122,7 @@ func TestGatewayDownloadTeamQR(t *testing.T) {
if err != nil {
t.Fatal(err)
}
defer resp2.Body.Close()
defer func() { _ = resp2.Body.Close() }()
if resp2.StatusCode != http.StatusNotFound {
t.Fatalf("missing game: %d", resp2.StatusCode)
}
@@ -198,7 +198,7 @@ func TestGatewayUploadRawZip(t *testing.T) {
if err != nil {
t.Fatalf("POST: %v", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusOK {
@@ -220,7 +220,7 @@ func TestGatewayDownloadZipWithContentDisposition(t *testing.T) {
if err != nil {
t.Fatalf("GET: %v", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusOK {
@@ -247,7 +247,7 @@ func TestGatewayDownloadFileNosniff(t *testing.T) {
if err != nil {
t.Fatalf("GET: %v", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusOK {
@@ -285,7 +285,7 @@ func TestGatewayUploadArchiveOverLimit(t *testing.T) {
if err != nil {
t.Fatalf("POST: %v", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusRequestEntityTooLarge {
@@ -309,7 +309,7 @@ func TestGatewayUploadFileOverHTTPLimit(t *testing.T) {
if err != nil {
t.Fatalf("POST: %v", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusRequestEntityTooLarge {
@@ -332,7 +332,7 @@ func TestGatewayUploadFileExactLimit(t *testing.T) {
if err != nil {
t.Fatalf("POST: %v", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusOK {
@@ -354,7 +354,7 @@ func TestGatewayUploadFileResourceExhausted(t *testing.T) {
if err != nil {
t.Fatalf("POST: %v", err)
}
defer resp.Body.Close()
defer func() { _ = resp.Body.Close() }()
body, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusRequestEntityTooLarge {