Merge pull request #468 from BlueGreenMagick/fix-comment-setwebexports

allow either \ or / in web exports filter
This commit is contained in:
Damien Elmes 2020-02-29 21:25:12 +10:00 committed by GitHub
commit e2c6fd464c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 5 deletions

View file

@ -161,11 +161,10 @@ class RequestHandler(http.server.SimpleHTTPRequestHandler):
if not pattern:
return path
if not re.fullmatch(pattern, subPath):
return path
newPath = os.path.join(addMgr.addonsFolder(), addonPath)
return newPath
subPath2 = subPath.replace(os.sep, "/")
if re.fullmatch(pattern, subPath) or re.fullmatch(pattern, subPath2):
newPath = os.path.join(addMgr.addonsFolder(), addonPath)
return newPath
return path

View file

@ -149,6 +149,8 @@ class WebContent:
f"/_addons/{addon_package}/web/my-addon.css")
web_content.js.append(
f"/_addons/{addon_package}/web/my-addon.js")
Note that '/' will also match the os specific path separator.
"""
body: str = ""