diff options
author | Yazan AbdAl-Rahman <yazan.abdalrahman@exalt.ps> | 2024-07-29 00:04:05 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-07-28 23:04:05 +0200 |
commit | 41f8988dc7f7e307af28af52e6d89469c824f214 (patch) | |
tree | 6f4623efb0111e6beae102ccb12b87e38d21b252 /tests/unit/serve_test.ts | |
parent | 50fa4d7ef5d0615d60042eda72e34adb773e2ecf (diff) |
fix(http): Adjust hostname display for Windows when using 0.0.0.0 (#24698)
Fixes #24687
---------
Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
Diffstat (limited to 'tests/unit/serve_test.ts')
-rw-r--r-- | tests/unit/serve_test.ts | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/tests/unit/serve_test.ts b/tests/unit/serve_test.ts index 4a7d53e1b..450ab6d93 100644 --- a/tests/unit/serve_test.ts +++ b/tests/unit/serve_test.ts @@ -748,9 +748,11 @@ Deno.test( const consoleLog = console.log; console.log = (msg) => { try { - const match = msg.match(/Listening on http:\/\/localhost:(\d+)\//); + const match = msg.match( + /Listening on http:\/\/(localhost|0\.0\.0\.0):(\d+)\//, + ); assert(!!match, `Didn't match ${msg}`); - const port = +match[1]; + const port = +match[2]; assert(port > 0 && port < 65536); } finally { ac.abort(); |