mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-14 10:18:14 +00:00
Merge remote-tracking branch 'origin/dev' into kai/fix/1118-ai-provider-model-rules
This commit is contained in:
commit
73c82b3567
5 files changed
+43
-5
No files matched your search
@@ -128,7 +128,7 @@ describe('management-api-client', () => {
|
||||
|
||||
expect(strategy).toBe('round-robin');
|
||||
expect(fetchMock).toHaveBeenCalledWith(
|
||||
'http://localhost:8317/routing/strategy',
|
||||
'http://localhost:8317/v0/management/routing/strategy',
|
||||
expect.objectContaining({
|
||||
method: 'PUT',
|
||||
body: JSON.stringify({ value: 'round-robin' }),
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
import { describe, expect, it } from 'bun:test';
|
||||
import { getCliproxyRoutingManagementUrl } from '../../../src/cliproxy/routing-strategy-http';
|
||||
import type { ProxyTarget } from '../../../src/cliproxy/proxy-target-resolver';
|
||||
|
||||
describe('routing-strategy-http', () => {
|
||||
it('builds the local management URL for routing strategy reads', () => {
|
||||
const target: ProxyTarget = {
|
||||
host: '127.0.0.1',
|
||||
port: 8317,
|
||||
protocol: 'http',
|
||||
isRemote: false,
|
||||
};
|
||||
|
||||
expect(getCliproxyRoutingManagementUrl(target)).toBe(
|
||||
'http://127.0.0.1:8317/v0/management/routing/strategy'
|
||||
);
|
||||
});
|
||||
|
||||
it('builds the remote management URL for routing strategy writes', () => {
|
||||
const target: ProxyTarget = {
|
||||
host: 'proxy.example.com',
|
||||
port: 443,
|
||||
protocol: 'https',
|
||||
allowSelfSigned: true,
|
||||
isRemote: true,
|
||||
};
|
||||
|
||||
expect(getCliproxyRoutingManagementUrl(target)).toBe(
|
||||
'https://proxy.example.com:443/v0/management/routing/strategy'
|
||||
);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user