Skip to content

Commit 8261608

Browse files
committed
test(agui-protocol): replace localhost with 127.0.0.1 in test requests
Using IP address instead of hostname for more reliable testing 将主机名替换为IP地址以获得更可靠的测试结果 Change-Id: I66a183d295e291f719d49d16d4c2c8cfc47a097a Signed-off-by: OhYee <oyohyee@oyohyee.com>
1 parent dc5f260 commit 8261608

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

tests/unittests/server/agui-protocol.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ async function makeRequest(
4444
): Promise<{ status: number; body: string; lines: string[] }> {
4545
return new Promise((resolve, reject) => {
4646
const options = {
47-
hostname: 'localhost',
47+
hostname: '127.0.0.1',
4848
port,
4949
path,
5050
method,

tests/unittests/server/server.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -860,7 +860,7 @@ function makeRequest(
860860
const urlObj = new URL(url);
861861

862862
const options: http.RequestOptions = {
863-
hostname: urlObj.hostname,
863+
hostname: '127.0.0.1',
864864
port: urlObj.port,
865865
path: urlObj.pathname,
866866
method,

0 commit comments

Comments
 (0)