fix(proxy): strip client fetch metadata upstream
This commit is contained in:
@@ -134,7 +134,9 @@ describe('ai proxy routes', () => {
|
||||
const response = createResponse();
|
||||
|
||||
const handled = await handleAiProxyRoutes(
|
||||
createRequest('POST', { model: 'deepseek-chat', messages: [] }),
|
||||
createRequest('POST', { model: 'deepseek-chat', messages: [] }, {
|
||||
'sec-fetch-mode': 'cors',
|
||||
}),
|
||||
response.res,
|
||||
new URL('http://127.0.0.1:13210/api/ai-proxy/v1/chat/completions?trace=1'),
|
||||
{} as never,
|
||||
@@ -155,6 +157,7 @@ describe('ai proxy routes', () => {
|
||||
const forwardedHeaders = fetchMock.mock.calls[0][1].headers as Record<string, string>;
|
||||
expect(forwardedHeaders.authorization).toBeUndefined();
|
||||
expect(forwardedHeaders.host).toBeUndefined();
|
||||
expect(forwardedHeaders['sec-fetch-mode']).toBeUndefined();
|
||||
expect(response.statusCode).toBe(200);
|
||||
expect(response.header('content-type')).toBe('application/json');
|
||||
expect(response.body()).toBe(JSON.stringify({ id: 'chatcmpl_1' }));
|
||||
|
||||
Reference in New Issue
Block a user