mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 04:15:52 +00:00
feat(proxy): add HEAD method support for health probe endpoints
This commit is contained in:
1 parent
8566e37feb
commit
baa58c9543
5 files changed
+119
-81
No files matched your search
@@ -83,6 +83,16 @@ describe('openai proxy daemon lifecycle', () => {
|
||||
).json()) as { data?: Array<{ id: string }> };
|
||||
expect(models.data?.map((entry) => entry.id)).toEqual(['qwen3-coder']);
|
||||
|
||||
const headRoot = await fetch(`http://127.0.0.1:${port}/`, { method: 'HEAD' });
|
||||
expect(headRoot.status).toBe(200);
|
||||
expect(headRoot.headers.get('content-type')).toBe('application/json');
|
||||
expect(await headRoot.text()).toBe('');
|
||||
|
||||
const headHealth = await fetch(`http://127.0.0.1:${port}/health`, { method: 'HEAD' });
|
||||
expect(headHealth.status).toBe(200);
|
||||
expect(headHealth.headers.get('content-type')).toBe('application/json');
|
||||
expect(await headHealth.text()).toBe('');
|
||||
|
||||
const stopped = await stopOpenAICompatProxy();
|
||||
expect(stopped.success).toBe(true);
|
||||
expect((await getOpenAICompatProxyStatus()).running).toBe(false);
|
||||
|
||||
Reference in new issue
Block a user