1
0
réplica de https://github.com/karl0ss/homepage.git sincronizado 2025-10-29 21:43:58 +00:00

Merge pull request #587 from benphelps/ping-fallback

Change: Add fallback to http GET for ping
Este cometimento está contido em:
shamoon 2022-11-30 00:45:03 -08:00 cometido por GitHub
ascendente c880fb344f 33bd349e43
cometimento b0cce6dbde
Não foi encontrada uma chave conhecida para esta assinatura, na base de dados
ID da chave GPG: 4AEE18F83AFDEB23

Ver ficheiro

@ -15,11 +15,18 @@ export default async function handler(req, res) {
});
}
const startTime = performance.now();
const [status] = await httpProxy(pingURL, {
let startTime = performance.now();
let [status] = await httpProxy(pingURL, {
method: "HEAD"
});
const endTime = performance.now();
let endTime = performance.now();
if (status >= 400 && status < 500) {
// try one more time as a GET in case HEAD is rejected for whatever reason
startTime = performance.now();
[status] = await httpProxy(pingURL);
endTime = performance.now();
}
return res.status(200).json({
status,