浏览代码

Fix bug where saving settings with blank username/password would require auth with blank user/pass

Chris Mullins 8 年之前
父节点
当前提交
6a738e7bab
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      lib/WebServer/MiLightHttpServer.cpp

+ 3 - 3
lib/WebServer/MiLightHttpServer.cpp

@@ -105,10 +105,10 @@ void MiLightHttpServer::handleDownloadUpdate(const UrlTokenBindings* bindings) {
 }
 
 void MiLightHttpServer::applySettings(Settings& settings) {
-  if (server.authenticationRequired() && !settings.hasAuthSettings()) {
-    server.disableAuthentication();
-  } else {
+  if (settings.hasAuthSettings()) {
     server.requireAuthentication(settings.adminUsername, settings.adminPassword);
+  } else {
+    server.disableAuthentication();
   }
   
   milightClient->setResendCount(settings.packetRepeats);