🐛 Fix for plugin vars that contain unicode
ETag calculation could otherwise fall flat on its face. Fixes #3088
This commit is contained in:
1 parent
b8dbc627cb
commit
2d7cb40633
1 file changed
+4
-2
@@ -21,7 +21,7 @@ from octoprint.server import app, userManager, pluginManager, gettext, \
|
||||
NOT_MODIFIED
|
||||
from octoprint.settings import settings
|
||||
from octoprint.filemanager import full_extension_tree, get_all_extensions
|
||||
from octoprint.util import to_unicode
|
||||
from octoprint.util import to_unicode, to_bytes
|
||||
|
||||
import re
|
||||
import base64
|
||||
@@ -196,7 +196,9 @@ def index():
|
||||
|
||||
default_additional_etag = [enable_accesscontrol,
|
||||
enable_gcodeviewer,
|
||||
enable_timelapse] + sorted(["{}:{}".format(k, v) for k, v in _plugin_vars.items()])
|
||||
enable_timelapse] + sorted(["{}:{}".format(to_bytes(k, errors="replace"),
|
||||
to_bytes(v, errors="replace"))
|
||||
for k, v in _plugin_vars.items()])
|
||||
|
||||
def get_preemptively_cached_view(key, view, data=None, additional_request_data=None, additional_unless=None):
|
||||
if (data is None and additional_request_data is None) or g.locale is None:
|
||||
|
||||
Reference in new issue
Block a user