Update util.ts

This commit is contained in:
Daniel Hougaard
2024-09-23 22:49:32 +04:00
parent 39d38a7382
commit 07a6aede92

View File

@@ -9,9 +9,7 @@ export const getAwsRegion = async () => {
} }
try { try {
const timeout = 1000; const tokenRes = await axios.put(AWS_TOKEN_METADATA_URI, undefined, {
const tokenRes = await axios.put(AWS_TOKEN_METADATA_URI, {
headers: { headers: {
"X-aws-ec2-metadata-token-ttl-seconds": "21600" "X-aws-ec2-metadata-token-ttl-seconds": "21600"
}, },
@@ -23,7 +21,7 @@ export const getAwsRegion = async () => {
"X-aws-ec2-metadata-token": tokenRes.data, "X-aws-ec2-metadata-token": tokenRes.data,
Accept: "application/json" Accept: "application/json"
}, },
timeout: timeout timeout: 5_000
}); });
return identityResponse.data.region; return identityResponse.data.region;