Rev1913, Support local address other than 127.0.0.1

This commit is contained in:
shortcutme 2017-02-16 20:56:07 +01:00
parent 39734dfadb
commit d57d82f439
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
6 changed files with 20 additions and 11 deletions

View file

@ -408,7 +408,7 @@ class FileRequest(object):
self.response({"ok": "Updated"})
def actionSiteReload(self, params):
if self.connection.ip != "127.0.0.1" and self.connection.ip != config.ip_external:
if self.connection.ip not in config.ip_local and self.connection.ip != config.ip_external:
self.response({"error": "Only local host allowed"})
site = self.sites.get(params["site"])
@ -419,7 +419,7 @@ class FileRequest(object):
self.response({"ok": "Reloaded"})
def actionSitePublish(self, params):
if self.connection.ip != "127.0.0.1" and self.connection.ip != config.ip_external:
if self.connection.ip not in config.ip_local and self.connection.ip != config.ip_external:
self.response({"error": "Only local host allowed"})
site = self.sites.get(params["site"])