You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Cannot download files that have "%20" in their filename. #2852
Root cause: PROPFIND builds oc:downloadURL with url.JoinPath, which unescapes its input, while the sibling href uses net.EncodePath, which does not. For a name that contains a literal %, the two results differ.
The web client downloads through oc:downloadURL. The browser therefore sends %20, the proxy decodes it to a space, and the storage lookup for firstword secondword.pdf returns 404 (the path shown in the access log):
GET …/firstword%20secondword.pdf -> 404 (decoded to a space; no such file)
GET …/firstword%2520secondword.pdf -> 200 (correctly encoded; the file is fine)
A public link still downloads the file: that path resolves the file by its share token and returns no oc:downloadURL, so the filename in the URL does not affect the lookup. A file shared with another user behaves the same way as the owner's view: the recipient receives the same under-encoded oc:downloadURL and also gets 404 (verified on a recipient account).
Where this happens in reva (vendored). PROPFIND builds two URLs for the same name; only the href is encoded correctly:
Downloading that under-encoded URL, one request top to bottom:
proxy access-log r.URL.Path = ".../firstword secondword.pdf" (%20 decoded to a space)
ocdav GET handler looks up the decoded path
gateway Stat
storage Stat not found: <spaceID>/firstword secondword.pdf <- origin
back up: storage NotFound -> ocdav errors -> 404
url.JoinPath is used here to keep a literal # working (see opencloud-eu/reva#415); because it unescapes its input, a literal % does not survive. net.EncodePath, the encoder the href already uses, escapes both # (to %23) and % (to %25), so it covers both cases. The GET handler and the proxy decode the URL they receive correctly; only the URL this property emits needs to change.
🤖 drafted with Claude Code, reviewed before submitting.
Activity
michaelstingl commentedon May 30, 2026
Root cause: PROPFIND builds
oc:downloadURLwithurl.JoinPath, which unescapes its input, while the siblinghrefusesnet.EncodePath, which does not. For a name that contains a literal%, the two results differ.The web client downloads through
oc:downloadURL. The browser therefore sends%20, the proxy decodes it to a space, and the storage lookup forfirstword secondword.pdfreturns 404 (the path shown in the access log):A public link still downloads the file: that path resolves the file by its share token and returns no
oc:downloadURL, so the filename in the URL does not affect the lookup. A file shared with another user behaves the same way as the owner's view: the recipient receives the same under-encodedoc:downloadURLand also gets 404 (verified on a recipient account).Where this happens in reva (vendored). PROPFIND builds two URLs for the same name; only the
hrefis encoded correctly:Downloading that under-encoded URL, one request top to bottom:
url.JoinPathis used here to keep a literal#working (see opencloud-eu/reva#415); because it unescapes its input, a literal%does not survive.net.EncodePath, the encoder thehrefalready uses, escapes both#(to%23) and%(to%25), so it covers both cases. The GET handler and the proxy decode the URL they receive correctly; only the URL this property emits needs to change.🤖 drafted with Claude Code, reviewed before submitting.
fix(ocdav): encode oc:downloadURL path so filenames with "%" round-trip
fix(ocdav): encode oc:downloadURL path so filenames with "%" round-trip
fix(ocdav): encode oc:downloadURL path so filenames with "%" round-trip
fix(ocdav): encode oc:downloadURL path so filenames with "%" round-trip
fix(ocdav): encode oc:downloadURL path so filenames with "%" round-trip
fix(ocdav): encode oc:downloadURL path so filenames with "%" round-trip
fix(ocdav): encode oc:downloadURL path so filenames with "%" round-trip
test(coreApiWebdavOperations): download a file with a literal "%" via…
test(coreApiWebdavOperations): download a file with a literal "%" via…
test(coreApiWebdavOperations): download a file with a literal "%" via…
test(coreApiWebdavOperations): download a file with a literal "%" via…