mirror of
https://github.com/9001/copyparty.git
synced 2025-09-28 12:42:26 -06:00
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)
This commit is contained in:
parent
422f8f624e
commit
98386f28f0
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue