fix: Host API port conflict crashing startup on Windows (#743)
This commit is contained in:
committed by
GitHub
Unverified
parent
06266cb4d2
commit
7e2c4d3835
@@ -30,7 +30,7 @@ describe('handleAppRoutes', () => {
|
||||
const handled = await handleAppRoutes(
|
||||
{ method: 'POST' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/app/openclaw-doctor'),
|
||||
new URL('http://127.0.0.1:13210/api/app/openclaw-doctor'),
|
||||
{} as never,
|
||||
);
|
||||
|
||||
@@ -48,7 +48,7 @@ describe('handleAppRoutes', () => {
|
||||
const handled = await handleAppRoutes(
|
||||
{ method: 'POST' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/app/openclaw-doctor'),
|
||||
new URL('http://127.0.0.1:13210/api/app/openclaw-doctor'),
|
||||
{} as never,
|
||||
);
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ describe('handleChannelRoutes', () => {
|
||||
const handled = await handleChannelRoutes(
|
||||
{ method: 'GET' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/channels/accounts'),
|
||||
new URL('http://127.0.0.1:13210/api/channels/accounts'),
|
||||
{
|
||||
gatewayManager: {
|
||||
rpc,
|
||||
@@ -241,7 +241,7 @@ describe('handleChannelRoutes', () => {
|
||||
await handleChannelRoutes(
|
||||
{ method: 'GET' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/channels/accounts'),
|
||||
new URL('http://127.0.0.1:13210/api/channels/accounts'),
|
||||
{
|
||||
gatewayManager: {
|
||||
rpc,
|
||||
@@ -296,7 +296,7 @@ describe('handleChannelRoutes', () => {
|
||||
const handled = await handleChannelRoutes(
|
||||
{ method: 'GET' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/channels/targets?channelType=qqbot&accountId=default'),
|
||||
new URL('http://127.0.0.1:13210/api/channels/targets?channelType=qqbot&accountId=default'),
|
||||
{
|
||||
gatewayManager: {
|
||||
rpc: vi.fn(),
|
||||
@@ -410,7 +410,7 @@ describe('handleChannelRoutes', () => {
|
||||
const handled = await handleChannelRoutes(
|
||||
{ method: 'GET' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/channels/targets?channelType=feishu&accountId=default'),
|
||||
new URL('http://127.0.0.1:13210/api/channels/targets?channelType=feishu&accountId=default'),
|
||||
{
|
||||
gatewayManager: {
|
||||
rpc: vi.fn(),
|
||||
@@ -469,7 +469,7 @@ describe('handleChannelRoutes', () => {
|
||||
const handled = await handleChannelRoutes(
|
||||
{ method: 'GET' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/channels/targets?channelType=wecom&accountId=default'),
|
||||
new URL('http://127.0.0.1:13210/api/channels/targets?channelType=wecom&accountId=default'),
|
||||
{
|
||||
gatewayManager: {
|
||||
rpc: vi.fn(),
|
||||
@@ -519,7 +519,7 @@ describe('handleChannelRoutes', () => {
|
||||
const handled = await handleChannelRoutes(
|
||||
{ method: 'GET' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/channels/targets?channelType=dingtalk&accountId=default'),
|
||||
new URL('http://127.0.0.1:13210/api/channels/targets?channelType=dingtalk&accountId=default'),
|
||||
{
|
||||
gatewayManager: {
|
||||
rpc: vi.fn(),
|
||||
@@ -571,7 +571,7 @@ describe('handleChannelRoutes', () => {
|
||||
const handled = await handleChannelRoutes(
|
||||
{ method: 'GET' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/channels/targets?channelType=wechat&accountId=wechat-bot'),
|
||||
new URL('http://127.0.0.1:13210/api/channels/targets?channelType=wechat&accountId=wechat-bot'),
|
||||
{
|
||||
gatewayManager: {
|
||||
rpc: vi.fn(),
|
||||
|
||||
@@ -43,7 +43,7 @@ describe('handleCronRoutes', () => {
|
||||
const handled = await handleCronRoutes(
|
||||
{ method: 'POST' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/cron/jobs'),
|
||||
new URL('http://127.0.0.1:13210/api/cron/jobs'),
|
||||
{
|
||||
gatewayManager: { rpc },
|
||||
} as never,
|
||||
@@ -89,7 +89,7 @@ describe('handleCronRoutes', () => {
|
||||
await handleCronRoutes(
|
||||
{ method: 'PUT' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/cron/jobs/job-2'),
|
||||
new URL('http://127.0.0.1:13210/api/cron/jobs/job-2'),
|
||||
{
|
||||
gatewayManager: { rpc },
|
||||
} as never,
|
||||
@@ -139,7 +139,7 @@ describe('handleCronRoutes', () => {
|
||||
await handleCronRoutes(
|
||||
{ method: 'PUT' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/cron/jobs/job-account'),
|
||||
new URL('http://127.0.0.1:13210/api/cron/jobs/job-account'),
|
||||
{
|
||||
gatewayManager: { rpc },
|
||||
} as never,
|
||||
@@ -178,7 +178,7 @@ describe('handleCronRoutes', () => {
|
||||
const handled = await handleCronRoutes(
|
||||
{ method: 'POST' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/cron/jobs'),
|
||||
new URL('http://127.0.0.1:13210/api/cron/jobs'),
|
||||
{
|
||||
gatewayManager: { rpc },
|
||||
} as never,
|
||||
|
||||
@@ -64,7 +64,7 @@ describe('host-api', () => {
|
||||
|
||||
expect(result.fallback).toBe(true);
|
||||
expect(fetchMock).toHaveBeenCalledWith(
|
||||
'http://127.0.0.1:3210/api/test',
|
||||
'http://127.0.0.1:13210/api/test',
|
||||
expect.objectContaining({ headers: expect.any(Object) }),
|
||||
);
|
||||
});
|
||||
@@ -97,7 +97,7 @@ describe('host-api', () => {
|
||||
|
||||
expect(result.fallback).toBe(true);
|
||||
expect(fetchMock).toHaveBeenCalledWith(
|
||||
'http://127.0.0.1:3210/api/test',
|
||||
'http://127.0.0.1:13210/api/test',
|
||||
expect.objectContaining({ headers: expect.any(Object) }),
|
||||
);
|
||||
});
|
||||
|
||||
@@ -24,7 +24,7 @@ describe('handleUsageRoutes', () => {
|
||||
const handled = await handleUsageRoutes(
|
||||
{ method: 'GET' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/usage/recent-token-history'),
|
||||
new URL('http://127.0.0.1:13210/api/usage/recent-token-history'),
|
||||
{} as never,
|
||||
);
|
||||
|
||||
@@ -44,7 +44,7 @@ describe('handleUsageRoutes', () => {
|
||||
await handleUsageRoutes(
|
||||
{ method: 'GET' } as IncomingMessage,
|
||||
{} as ServerResponse,
|
||||
new URL('http://127.0.0.1:3210/api/usage/recent-token-history?limit=50.9'),
|
||||
new URL('http://127.0.0.1:13210/api/usage/recent-token-history?limit=50.9'),
|
||||
{} as never,
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user