fix(gateway): prevent /api/* routes from returning SPA HTML when basePath is empty (#30333)

Merged via squash.

Prepared head SHA: 12591f304e
Co-authored-by: Sid-Qin <201593046+Sid-Qin@users.noreply.github.com>
Co-authored-by: velvet-shark <126378+velvet-shark@users.noreply.github.com>
Reviewed-by: @velvet-shark
This commit is contained in:
Sid
2026-03-02 05:23:54 +08:00
committed by GitHub
parent e6049345db
commit c1428e8df9
4 changed files with 23 additions and 2 deletions

View File

@@ -1325,7 +1325,6 @@ describe("Cron issue regressions", () => {
});
it("respects abort signals while retrying main-session wake-now heartbeat runs", async () => {
vi.useRealTimers();
const abortController = new AbortController();
const runHeartbeatOnce = vi.fn(
async (): Promise<HeartbeatRunResult> => ({
@@ -1364,7 +1363,10 @@ describe("Cron issue regressions", () => {
abortController.abort();
}, 10);
const result = await executeJobCore(state, mainJob, abortController.signal);
const resultPromise = executeJobCore(state, mainJob, abortController.signal);
// Advance virtual time so the abort fires before the busy-wait fallback window expires.
await vi.advanceTimersByTimeAsync(10);
const result = await resultPromise;
expect(result.status).toBe("error");
expect(result.error).toContain("timed out");