Added local-only auto-authorize for API
This commit is contained in:
parent
5e2b29466b
commit
a82be2775f
3 changed files with 43 additions and 6 deletions
|
@ -174,6 +174,11 @@ int Controller::handleAPIConnection(Socket::Connection & conn){
|
|||
}
|
||||
{//lock the config mutex here - do not unlock until done processing
|
||||
tthread::lock_guard<tthread::mutex> guard(configMutex);
|
||||
//Are we local and not forwarded? Instant-authorized.
|
||||
if (!authorized && !H.hasHeader("X-Real-IP") && conn.isLocal()){
|
||||
INFO_MSG("Local API access automatically authorized");
|
||||
authorized = true;
|
||||
}
|
||||
//if already authorized, do not re-check for authorization
|
||||
if (authorized){
|
||||
Response["authorize"]["status"] = "OK";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue