mirror of
https://github.com/Yonle/bostr.git
synced 2025-11-20 10:56:25 +01:00
bouncer: if nobot is being set, don't perform request for bot/scraper/crawler/similiar.
Signed-off-by: Yonle <yonle@lecturify.net>
This commit is contained in:
2
auth.js
2
auth.js
@@ -8,7 +8,7 @@ module.exports = (authKey, data, ws, req) => {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!authorized_keys?.includes(data.pubkey) && !(private_keys && private_keys[data.pubkey])) {
|
||||
if ((authorized_keys?.length || Object.keys(private_keys).length) && !authorized_keys?.includes(data.pubkey) && !(private_keys && private_keys[data.pubkey])) {
|
||||
ws.send(JSON.stringify(["OK", data.id, false, "unauthorized."]));
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user