diff --git a/CHANGELOG.md b/CHANGELOG.md index 0b897447..09ca9393 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,17 @@ # Change log +### v0.10.2 +* Only render templates from within the declared jinja template directory. + +### v0.10.1 +* Avoid name collisions when using Electron, so jQuery etc work normally + ## v0.10.0 * Corrective version bump after new feature included in 0.9.13 * Fix a bug with example 06 for Jinja templating; the `templates` kwarg to `eel.start` takes a filepath, not a bool. -## v0.9.13 +### v0.9.13 * Add support for Jinja templating. -## Earlier +### Earlier * No changelog notes for earlier versions. diff --git a/eel/__init__.py b/eel/__init__.py index a7015f21..9d7a83f5 100644 --- a/eel/__init__.py +++ b/eel/__init__.py @@ -153,12 +153,14 @@ def _eel(): @btl.route('/') def _static(path): - if _jinja_env != None: - n = len(_jinja_templates + '/') + template_prefix = _jinja_templates + '/' + + if _jinja_env != None and path.startswith(template_prefix): + n = len(template_prefix) template = _jinja_env.get_template(path[n:]) return template.render() - else: - return btl.static_file(path, root=root_path) + + return btl.static_file(path, root=root_path) @btl.get('/eel', apply=[wbs.websocket]) diff --git a/setup.py b/setup.py index e0eff14d..a361b003 100644 --- a/setup.py +++ b/setup.py @@ -3,7 +3,7 @@ setup( name='Eel', - version='0.10.1', + version='0.10.2', author='Chris Knott', author_email='chrisknott@hotmail.co.uk', packages=['eel'],