From b9c620304c540fb5a61627bbdbcdd93582ff1d96 Mon Sep 17 00:00:00 2001 From: JustMe Date: Mon, 12 Oct 2026 01:58:41 +0800 Subject: [PATCH] fix(ci): stabilize oversized body check [CI] --- server/tests/WebDrop.Api.Tests/RestTests.cs | 2 +- server/tests/WebDrop.Api.Tests/ServerFixture.cs | 8 +++++++- web/src/styles/base.css | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/server/tests/WebDrop.Api.Tests/RestTests.cs b/server/tests/WebDrop.Api.Tests/RestTests.cs index ab9c832..c6f6f61 100644 --- a/server/tests/WebDrop.Api.Tests/RestTests.cs +++ b/server/tests/WebDrop.Api.Tests/RestTests.cs @@ -193,7 +193,7 @@ public class RestTests(ServerFixture s) : IClassFixture // 超过 1 MiB 负载上限但小于 Kestrel 的 2 MiB:服务自己拒绝 await AssertErrorAsync(await s.AppendAsync(ch, ch.Owner, Frame(NewId(), 0, 1, 1_500_000)), 413, "too_large"); // 超过 Kestrel 上限:框架拒绝,仍映射为同一错误码 - await AssertErrorAsync(await s.AppendAsync(ch, ch.Owner, Frame(NewId(), 0, 1, 3_000_000)), 413, "too_large"); + await AssertErrorAsync(await s.AppendAsync(ch, ch.Owner, Frame(NewId(), 0, 1, 3_000_000), expectContinue: true), 413, "too_large"); } [Fact] diff --git a/server/tests/WebDrop.Api.Tests/ServerFixture.cs b/server/tests/WebDrop.Api.Tests/ServerFixture.cs index bd614a7..88f0215 100644 --- a/server/tests/WebDrop.Api.Tests/ServerFixture.cs +++ b/server/tests/WebDrop.Api.Tests/ServerFixture.cs @@ -129,10 +129,16 @@ public sealed class ServerFixture : IAsyncLifetime, IAsyncDisposable public async Task JoinAsync(Chan ch, Who who) => await Http.SendAsync(Req(HttpMethod.Post, $"/api/v1/channels/{ch.Id}/seats", who)); - public async Task AppendAsync(Chan ch, Who who, byte[] frame, string? maxDownloads = null) + public async Task AppendAsync( + Chan ch, + Who who, + byte[] frame, + string? maxDownloads = null, + bool expectContinue = false) { var req = Req(HttpMethod.Post, $"/api/v1/channels/{ch.Id}/frames", who, Bytes(frame)); if (maxDownloads is not null) req.Headers.Add("X-WD-Max-Downloads", maxDownloads); + req.Headers.ExpectContinue = expectContinue; return await Http.SendAsync(req); } diff --git a/web/src/styles/base.css b/web/src/styles/base.css index 00a7df8..b8518e8 100644 --- a/web/src/styles/base.css +++ b/web/src/styles/base.css @@ -45,7 +45,7 @@ summary, /* iOS Safari 对小于 16px 的输入框聚焦时会自动放大页面 */ @media (pointer: coarse) { - input:not([type="checkbox"]):not([type="radio"]), + input:not([type="checkbox"], [type="radio"]), textarea, select { font-size: 16px;