Merge branch 'development' into LTS_development

This commit is contained in:
Thulinma 2017-04-18 12:32:39 +02:00
commit 7629b00a4c
10 changed files with 65 additions and 17 deletions

View file

@ -196,6 +196,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";