Your ROOT_URL in app.ini is https://git.cloudchain.link/ but you are visiting https://dash.bss.nz/open-source-mirrors/homepage/commit/f1a33f10edaa199c37a0bfce65562d84c838c9a6?style=split&whitespace=show-all
You should set ROOT_URL correctly, otherwise the web may not work correctly.
1 changed files with
24 additions and
17 deletions
@ -14,22 +14,29 @@ export default async function handler(req, res) {
error : "No ping URL given" ,
error : "No ping URL given" ,
} ) ;
} ) ;
}
}
let startTime = performance . now ( ) ;
let [ status ] = await httpProxy ( pingURL , {
method : "HEAD"
} ) ;
let endTime = performance . now ( ) ;
if ( status > 403 ) {
// 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 ( {
try {
status ,
let startTime = performance . now ( ) ;
latency : endTime - startTime
let [ status ] = await httpProxy ( pingURL , {
} ) ;
method : "HEAD"
} ) ;
let endTime = performance . now ( ) ;
if ( status > 403 ) {
// 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 ,
latency : endTime - startTime
} ) ;
} catch ( e ) {
logger . debug ( "Error attempting ping: %s" , JSON . stringify ( e ) ) ;
return res . status ( 400 ) . send ( {
error : 'Error attempting ping, see logs.' ,
} ) ;
}
}
}