summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMicah Lee <micah@micahflee.com>2019-10-13 09:55:36 -0700
committerMicah Lee <micah@micahflee.com>2019-10-13 09:55:36 -0700
commit8f1e09875be594b5713908bb9d92894a663b2210 (patch)
treed5e88cc4038e67f732a3925f43b3bb10fca4b09c
parentcc2cead50b9053fe97672634be47673549395eb3 (diff)
downloadonionshare-8f1e09875be594b5713908bb9d92894a663b2210.tar.gz
onionshare-8f1e09875be594b5713908bb9d92894a663b2210.zip
Initialize the flask app with a random static path, to avoid issue where /static doesn't work in website mode
-rw-r--r--onionshare/web/web.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/onionshare/web/web.py b/onionshare/web/web.py
index 4c4207e6..b5b805ec 100644
--- a/onionshare/web/web.py
+++ b/onionshare/web/web.py
@@ -68,6 +68,9 @@ class Web:
self.app = Flask(
__name__,
static_folder=self.common.get_resource_path("static"),
+ static_url_path="/static_".format(
+ self.common.random_string(16)
+ ), # randomize static_url_path to avoid making /static unusable
template_folder=self.common.get_resource_path("templates"),
)
self.app.secret_key = self.common.random_string(8)