From 98386f28f0789c86973a5c6829fddb4640ff33e2 Mon Sep 17 00:00:00 2001 From: ed Date: Sun, 7 Sep 2025 20:54:37 +0000 Subject: [PATCH] simplify og_ua logic; idk what this was *supposed* to do but what it *did* was prevent loading the full image even when the request had a good referrer (this broke viewing images in firefox at least) --- copyparty/httpcli.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/copyparty/httpcli.py b/copyparty/httpcli.py index 70eedbb1..42b373e5 100644 --- a/copyparty/httpcli.py +++ b/copyparty/httpcli.py @@ -6224,16 +6224,13 @@ class HttpCli(object): add_og = "og" in vn.flags if add_og: if "th" in self.uparam or "raw" in self.uparam: - og_ua = add_og = False + add_og = False elif vn.flags["og_ua"]: - og_ua = add_og = vn.flags["og_ua"].search(self.ua) - else: - og_ua = False - add_og = True + add_og = vn.flags["og_ua"].search(self.ua) og_fn = "" if "v" in self.uparam: - add_og = og_ua = True + add_og = True if "b" in self.uparam: self.out_headers["X-Robots-Tag"] = "noindex, nofollow" @@ -6354,7 +6351,7 @@ class HttpCli(object): is_md = abspath.lower().endswith(".md") if add_og and not is_md: - if og_ua or self.host not in self.headers.get("referer", ""): + if self.host not in self.headers.get("referer", ""): self.vpath, og_fn = vsplit(self.vpath) vpath = self.vpath vn, rem = self.asrv.vfs.get(self.vpath, self.uname, False, False)