Skip to content

test(coreApiWebdavOperations): download a file with a literal "%" via its oc:downloadURL#3079

Open
michaelstingl wants to merge 1 commit into
opencloud-eu:mainfrom
michaelstingl:issue-2852-downloadurl-encoding
Open

test(coreApiWebdavOperations): download a file with a literal "%" via its oc:downloadURL#3079
michaelstingl wants to merge 1 commit into
opencloud-eu:mainfrom
michaelstingl:issue-2852-downloadurl-encoding

Conversation

@michaelstingl

Copy link
Copy Markdown
Contributor

Description

Adds one scenario to tests/acceptance/features/coreApiWebdavOperations/downloadFile.feature: a file whose name contains a literal % downloads via its oc:downloadURL, returning 200 and the content.

It mirrors the web client's download flow: read the server-built oc:downloadURL from a PROPFIND and GET it as-is (the signature in the URL authenticates the request, so no credentials are sent). A plain WebDAV downloads file step would not cover this, because it builds and encodes the request path itself, whereas the bug is in the server-generated oc:downloadURL.

One new step-def in WebDavPropertiesContext, user "X" downloads the "P" file via its oc:downloadURL, reuses the existing PROPFIND helper and HttpRequestHelper::get. It uses a regex annotation because the : in oc:downloadURL collides with the turnip :placeholder syntax.

Related Issue

Locks the behaviour from #2852 (closed) in the acceptance suite. The fix itself is in reva:

Motivation and Context

A name with a literal % (for example firstword%20secondword.txt) 404'd on download because the oc:downloadURL did not percent-encode the path, so a URL parser collapsed the %20 back to a space. The reva fix corrected it; this pins the round-trip at the product boundary so a regression fails the suite.

How Has This Been Tested?

Locally, the feature against a running server, on two builds and both storages:

  • opencloud on the shipped reva (has the fix): downloadFile.feature passes on posix and decomposed (81/81), the new scenario green on old/new/spaces.
  • opencloud built on a reva with the fix reverted: only the new scenario fails, with the download returning 404 (the reporter's exact symptom), on posix.

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Technical debt
  • Tests only (no source changes)

Checklist:

  • Code changes
  • Unit tests added
  • Acceptance tests added
  • Documentation added (n/a: tests-only, no changelog fragment)

🤖 drafted with Claude Code, reviewed before submitting.

… its oc:downloadURL

A file whose name contains a literal "%" 404s on download because the
server-built oc:downloadURL did not percent-encode the path (opencloud-eu#2852, fixed in
reva by opencloud-eu/reva#653). Add a scenario mirroring
the web client download flow: read the oc:downloadURL from PROPFIND and GET it
as-is (the signature in the URL authenticates it), asserting 200 and the content.

The new step "user X downloads the P file via its oc:downloadURL" lives in
WebDavPropertiesContext; a regex annotation avoids the ":" in oc:downloadURL
colliding with the turnip :placeholder syntax.

Verified red->green on posix and decomposed: red on an opencloud built on a reva
with the fix reverted (the download 404s), green on the shipped reva.

opencloud-eu#2852
@codacy-production

Copy link
Copy Markdown

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant