Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[tests-only] Allow 400 bad request for requests to meta endpoint that do not request meta-path-for-user #40010

Merged
merged 1 commit into from
Apr 25, 2022

Conversation

phil-davis
Copy link
Contributor

Description

There are various test scenarios that check invalid/unauthorised attempts to access remote.php/dav/meta API endpoints.
The tests just send a PROPFIND directly to the endpoint, without specifying any request body that mentions oc:meta-path-for-user. The documentation https://doc.owncloud.com/server/next/developer_manual/webdav_api/meta.html#meta-files-xml does not mention exactly what should happen if the body is empty.

oC10 returns 404 "not found". But it is also reasonable for an implementation to return 400 "bad request" (and requires that the request has a "proper" XML body in the PROPFIND request.

This PR adjusts the tests so that they will accept either 400 or 404 as the HTTP status of these requests. This will help the tests to pass with reva and oCIS. In particular, see cs3org/reva#2741

How Has This Been Tested?

CI

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Database schema changes (next release will require increase of minor version instead of patch)
  • 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 ticket raised:
  • Changelog item, see TEMPLATE

@phil-davis phil-davis self-assigned this Apr 25, 2022
@phil-davis
Copy link
Contributor Author

Note: I will make a separate issue to add/improve the test scenarios so that they (also) send PROPFIND requests to the meta endpoint with the documented request body. That will help us be sure that "well-formed" requests are also processed correctly.

@phil-davis phil-davis changed the title [tests-only] Allow 400 bad request for reqquests to meta endpoint that do not request meta-path-for-user [tests-only] Allow 400 bad request for requests to meta endpoint that do not request meta-path-for-user Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants