mirror of
https://github.com/diegosouzapw/OmniRoute.git
synced 2026-08-08 08:12:20 +03:00
Compare commits
6 Commits
green/8728
...
feat/6736-
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8e2fd2f5a8 | ||
|
|
c560742eb3 | ||
|
|
c8fc9148dc | ||
|
|
7b84a9cf1c | ||
|
|
0dc2b9b021 | ||
|
|
58eeb53d88 |
1
changelog.d/features/6736-response-content-encoding.md
Normal file
1
changelog.d/features/6736-response-content-encoding.md
Normal file
@@ -0,0 +1 @@
|
||||
- **feat(api):** add response content encoding verification — confirms Next.js compress:true and documents stripStaleForwardingHeaders behavior ([#6736](https://github.com/diegosouzapw/OmniRoute/issues/6736))
|
||||
@@ -189,6 +189,7 @@
|
||||
"tests/unit/combo/effective-max-concurrency.test.ts",
|
||||
"tests/unit/combo/recovery-hint.test.ts",
|
||||
"tests/unit/complexity-aware-scoring-wiring.test.ts",
|
||||
"tests/unit/compression-header-verification.test.ts",
|
||||
"tests/unit/context-pinning-tool-calls.test.ts",
|
||||
"tests/unit/cooldown-epoch-string-3954.test.ts",
|
||||
"tests/unit/correctness/combo.property.test.ts",
|
||||
|
||||
36
tests/unit/compression-header-verification.test.ts
Normal file
36
tests/unit/compression-header-verification.test.ts
Normal file
@@ -0,0 +1,36 @@
|
||||
import { describe, it } from "node:test";
|
||||
import { ok, equal } from "node:assert/strict";
|
||||
|
||||
describe("Response compression verification (#6736)", () => {
|
||||
it("next.config.mjs has compress: true", async () => {
|
||||
// Read the config file and verify compression is enabled
|
||||
const fs = await import("fs");
|
||||
const content = fs.readFileSync("next.config.mjs", "utf-8");
|
||||
ok(content.includes("compress: true"), "Next.js compression should be enabled");
|
||||
});
|
||||
|
||||
it("stripStaleForwardingHeaders deletes content-encoding", async () => {
|
||||
const { stripStaleForwardingHeaders } = await import(
|
||||
"@/../open-sse/handlers/chatCore/responseHeaders"
|
||||
);
|
||||
const headers = new Headers({ "content-encoding": "gzip", "x-custom": "keep" });
|
||||
stripStaleForwardingHeaders(headers);
|
||||
equal(headers.has("content-encoding"), false, "content-encoding should be stripped");
|
||||
ok(headers.has("x-custom"), "custom headers should survive");
|
||||
});
|
||||
|
||||
it("stripStaleForwardingHeaders deletes content-length and transfer-encoding", async () => {
|
||||
const { stripStaleForwardingHeaders } = await import(
|
||||
"@/../open-sse/handlers/chatCore/responseHeaders"
|
||||
);
|
||||
const headers = new Headers({
|
||||
"content-length": "1024",
|
||||
"content-encoding": "gzip",
|
||||
"transfer-encoding": "chunked",
|
||||
});
|
||||
stripStaleForwardingHeaders(headers);
|
||||
equal(headers.has("content-length"), false);
|
||||
equal(headers.has("content-encoding"), false);
|
||||
equal(headers.has("transfer-encoding"), false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user