From f163abb4a5b1dcf2b7ace5591cf2ecfaea2dcc68 Mon Sep 17 00:00:00 2001 From: D14na Date: Thu, 24 Jan 2019 08:41:27 -0500 Subject: [PATCH] Add support for tilde `~` in filenames. (source: https://webpack.js.org/guides/code-splitting) It appears that webpack (bundled w/ the VueJS CLI) will concatenate `chunk` names using the `~` to create one long "bundled" filename. This creates a problem when executing `isValidRelativePath` which DOES NOT allow `~`. __An example error when signing:__ `Site:1... - [ERROR] Invalid filename: js/about~privacy~search.3c7ce85b.js` A fix is to use the same name for each file/chunk, but then that breaks the optimizations of code splitting. Is there any reason NOT to permit tilde `~` as a valid filename character? _(NOTE: this may only be an issue if using vue-router)_ --- src/Content/ContentManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Content/ContentManager.py b/src/Content/ContentManager.py index 1d5d2c84..6b10b4b0 100644 --- a/src/Content/ContentManager.py +++ b/src/Content/ContentManager.py @@ -552,7 +552,7 @@ class ContentManager(object): elif len(relative_path) > 255: return False else: - return re.match("^[a-z\[\]\(\) A-Z0-9_@=\.\+-/]+$", relative_path) + return re.match("^[a-z\[\]\(\) A-Z0-9~_@=\.\+-/]+$", relative_path) def sanitizePath(self, inner_path): return re.sub("[^a-z\[\]\(\) A-Z0-9_@=\.\+-/]", "", inner_path)