Disable api page + public apis when settings.display.api = false

This commit is contained in:
joeuhren
2020-12-31 15:45:31 -07:00
parent 2fd39d76ce
commit f70952f66b
3 changed files with 20 additions and 13 deletions
+1 -1
View File
@@ -85,7 +85,7 @@ module.exports = function() {
var method_enabled = settings.public_api.rpc[method];
// only show disabled msg for outside calls. internal calls should always go through
if (method_enabled == null || !method_enabled && req.headers.host.indexOf('127.0.0.1') == -1)
if ((!settings.display.api || method_enabled == null || !method_enabled) && req.headers.host.indexOf('127.0.0.1') == -1)
res.end('This method is disabled');
else {
if (accesslist.type == 'all')