Rev2180, Allow ajax requests using ajax_key http get parameter

This commit is contained in:
shortcutme 2017-08-15 02:40:38 +02:00
parent 0a380dc0ab
commit 1db2327b3d
No known key found for this signature in database
GPG key ID: 5B63BAE6CB9613AE
6 changed files with 34 additions and 5 deletions

View file

@ -68,6 +68,10 @@ class Site(object):
self.settings["wrapper_key"] = CryptHash.random()
self.log.debug("New wrapper key: %s" % self.settings["wrapper_key"])
if not self.settings.get("ajax_key"): # To auth websocket permissions
self.settings["ajax_key"] = CryptHash.random()
self.log.debug("New ajax key: %s" % self.settings["ajax_key"])
def __str__(self):
return "Site %s" % self.address_short