fix: invalid api key should stop request once detected

This commit is contained in:
2025-05-02 16:58:42 -07:00
parent a78e3201cb
commit 9a9e4ebedf

View File

@@ -1316,6 +1316,7 @@ const server = http.createServer( ( request, response ) =>
Log.error( `www`, chalk.yellow( `[req]` ), chalk.white( `` ), chalk.blueBright( `<message>` ), chalk.redBright( `unauthorized (401): incorrect api key specified` ), chalk.blueBright( `<type>` ), chalk.gray( `api/restart` ), chalk.blueBright( `<file>` ), chalk.gray( `${ loadFile }` ), chalk.blueBright( `<method>` ), chalk.gray( `${ method }` ) ); Log.error( `www`, chalk.yellow( `[req]` ), chalk.white( `` ), chalk.blueBright( `<message>` ), chalk.redBright( `unauthorized (401): incorrect api key specified` ), chalk.blueBright( `<type>` ), chalk.gray( `api/restart` ), chalk.blueBright( `<file>` ), chalk.gray( `${ loadFile }` ), chalk.blueBright( `<method>` ), chalk.gray( `${ method }` ) );
response.end( JSON.stringify( statusCheck ) ); response.end( JSON.stringify( statusCheck ) );
return;
} }
await initialize(); await initialize();