wopi: fix onlyoffice opening docs in readonly mode (#1585)

This commit is contained in:
Danila Kamaev 2026-08-04 02:02:18 +04:00 committed by GitHub
parent b9405a3e25
commit fdf52a8c4e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1682,7 +1682,9 @@ class HttpCli(object):
xml = buf.decode(enc, "replace") xml = buf.decode(enc, "replace")
xroot = parse_xml(xml) xroot = parse_xml(xml)
ext = vpath.split(".")[-1] ext = vpath.split(".")[-1]
url = xroot.find(".//action[@ext='%s'][@urlsrc]" % (ext,)).get("urlsrc") url = xroot.find(
".//action[@ext='%s'][@name='edit'][@urlsrc]" % (ext,)
).get("urlsrc")
if not url.endswith(("?", "&")): if not url.endswith(("?", "&")):
url += "&" if "?" in url else "?" url += "&" if "?" in url else "?"
url += "WOPISrc=" url += "WOPISrc="