fix(gateway): enforce request body size limits
This commit is contained in:
@@ -28,6 +28,26 @@ describe('configSchema — sandbox', () => {
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema — server', () => {
|
||||
const minimalConfig = {
|
||||
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
|
||||
models: { default: { provider: 'anthropic', model: 'claude-3' } },
|
||||
};
|
||||
|
||||
it('defaults max_request_body_bytes', () => {
|
||||
const result = configSchema.parse(minimalConfig);
|
||||
expect(result.server.max_request_body_bytes).toBe(1_048_576);
|
||||
});
|
||||
|
||||
it('accepts custom max_request_body_bytes', () => {
|
||||
const result = configSchema.parse({
|
||||
...minimalConfig,
|
||||
server: { max_request_body_bytes: 2048 },
|
||||
});
|
||||
expect(result.server.max_request_body_bytes).toBe(2048);
|
||||
});
|
||||
});
|
||||
|
||||
describe('configSchema — agent_configs', () => {
|
||||
const minimalConfig = {
|
||||
telegram: { bot_token: 'test', allowed_chat_ids: [1] },
|
||||
|
||||
Reference in New Issue
Block a user