about summary refs log tree commit diff
path: root/pkgs/servers/home-assistant/patches/static-follow-symlinks.patch
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/servers/home-assistant/patches/static-follow-symlinks.patch')
-rw-r--r--pkgs/servers/home-assistant/patches/static-follow-symlinks.patch12
1 files changed, 12 insertions, 0 deletions
diff --git a/pkgs/servers/home-assistant/patches/static-follow-symlinks.patch b/pkgs/servers/home-assistant/patches/static-follow-symlinks.patch
new file mode 100644
index 0000000000000..c99a8d88a1e8b
--- /dev/null
+++ b/pkgs/servers/home-assistant/patches/static-follow-symlinks.patch
@@ -0,0 +1,12 @@
+diff --git a/homeassistant/components/http/static.py b/homeassistant/components/http/static.py
+index e6e773d4c0..b53e0b4a11 100644
+--- a/homeassistant/components/http/static.py
++++ b/homeassistant/components/http/static.py
+@@ -31,7 +31,6 @@ def _get_file_path(rel_url: str, directory: Path) -> Path | None:
+         # where the static dir is totally different
+         raise HTTPForbidden
+     filepath: Path = directory.joinpath(filename).resolve()
+-    filepath.relative_to(directory)
+     # on opening a dir, load its contents if allowed
+     if filepath.is_dir():
+         return None