Skip to content
This repository was archived by the owner on Dec 14, 2025. It is now read-only.

Commit 231ca5c

Browse files
author
Benjamin E. Coe
authored
fix: use 3s timeout rather than 15 default (#237)
1 parent d04207b commit 231ca5c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {request} from 'gaxios';
99
import {OutgoingHttpHeaders} from 'http';
1010
const jsonBigint = require('json-bigint');
1111

12-
export const HOST_ADDRESS = 'http://metadata.google.internal.';
12+
export const HOST_ADDRESS = 'http://169.254.169.254';
1313
export const BASE_PATH = '/computeMetadata/v1';
1414
export const BASE_URL = HOST_ADDRESS + BASE_PATH;
1515
export const HEADER_NAME = 'Metadata-Flavor';
@@ -65,6 +65,7 @@ async function metadataAccessor<T>(
6565
retryConfig: {noResponseRetries},
6666
params: options.params,
6767
responseType: 'text',
68+
timeout: 3000,
6869
});
6970
// NOTE: node.js converts all incoming headers to lower case.
7071
if (res.headers[HEADER_NAME.toLowerCase()] !== HEADER_VALUE) {

0 commit comments

Comments
 (0)