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

Fix OC storage property removal #728

Merged
merged 1 commit into from
May 8, 2020
Merged

Fix OC storage property removal #728

merged 1 commit into from
May 8, 2020

Conversation

PVince81
Copy link
Contributor

@PVince81 PVince81 commented May 8, 2020

Whenever a non-existing property must be removed, we should ignore the
error.

Also note: PROPPATCH spec says that removing a non-existing property is ok: http://www.webdav.org/specs/rfc2518.html#ELEMENT_remove

Whenever a non-existing property must be removed, we should ignore the
error.
@PVince81 PVince81 requested a review from labkode as a code owner May 8, 2020 09:29
@PVince81
Copy link
Contributor Author

PVince81 commented May 8, 2020

To test, run this twice after setting the properties in question:

curl -D - -u einstein:relativity -X PROPPATCH -H "Content-Type: text/xml" --data-binary "@proppatch-remove.xml" "http://localhost:9140/remote.php/webdav/test"

with the file proppatch-remove.xml:

<?xml version="1.0" encoding="utf-8"?>
<D:propertyupdate xmlns:D="DAV:">
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/alpha"/>
    </D:prop>
  </D:remove>
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/beta"/>
    </D:prop>
  </D:remove>
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/gamma"/>
    </D:prop>
  </D:remove>
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/delta"/>
    </D:prop>
  </D:remove>
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/epsilon"/>
    </D:prop>
  </D:remove>
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/zeta"/>
    </D:prop>
  </D:remove>
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/eta"/>
    </D:prop>
  </D:remove>
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/theta"/>
    </D:prop>
  </D:remove>
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/iota"/>
    </D:prop>
  </D:remove>
  <D:remove>
    <D:prop>
      <somename xmlns="http://example.com/kappa"/>
    </D:prop>
  </D:remove>
</D:propertyupdate>

Before the fix we got 500 Internal server error because "data is unavailble".
After the fix we get a 207 response.

@labkode labkode merged commit f702138 into cs3org:master May 8, 2020
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.

2 participants