Remove unnecessary imports from cors plugin

This commit is contained in:
shortcutme 2018-01-28 16:43:50 +01:00
parent 1566da1f8f
commit 335a7a76b1
No known key found for this signature in database
GPG Key ID: 5B63BAE6CB9613AE
1 changed files with 4 additions and 4 deletions

View File

@ -4,11 +4,10 @@ import copy
from Plugin import PluginManager
from Translate import Translate
from util import helper
from Debug import Debug
if "_" not in locals():
_ = Translate("plugins/Cors/languages/")
def getCorsPath(site, inner_path):
match = re.match("^cors-([A-Za-z0-9]{26,35})/(.*)", inner_path)
if not match:
@ -59,7 +58,7 @@ class UiWebsocketPlugin(object):
site_name = address
button_title = _["Grant & Add"]
if site and "Cors:"+address in self.permissions:
if site and "Cors:" + address in self.permissions:
return "ignored"
self.cmd(
@ -69,11 +68,12 @@ class UiWebsocketPlugin(object):
)
def cbCorsPermission(self, to, address):
self.actionPermissionAdd(to, "Cors:"+address)
self.actionPermissionAdd(to, "Cors:" + address)
site = self.server.sites.get(address)
if not site:
self.server.site_manager.need(address)
@PluginManager.registerTo("UiRequest")
class UiRequestPlugin(object):
# Allow to load cross origin files using /cors-address/file.jpg