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

Properly implement locking for non-existent resources #21

Closed
doxavore opened this issue Aug 24, 2011 · 1 comment
Closed

Properly implement locking for non-existent resources #21

doxavore opened this issue Aug 24, 2011 · 1 comment

Comments

@doxavore
Copy link
Contributor

DAV4Rack::Controller#lock raises a NotFound response when the resource doesn't exist. This isn't correct behavior, per RFP4918 sections 7.3 Write Locks and Unmapped URLs and 9.10.4 Locking Unmapped URLs: http://www.webdav.org/specs/rfc4918.html Finder on Mac OS X will not allow you to create files and will revert to treating the server as read-only when it doesn't properly implement this spec form of locking.

I believe the best course of action may be to allow the resource.lock(asked) call, as the resource should decide if it should create itself as a blank file (generally correct per the spec) or do something else.

Is there any reason we can't start by removing the raise NotFound unless resource.exist? line, as resource.exist? has no knowledge that this is an attempt at locking?

chrisroberts added a commit that referenced this issue Aug 25, 2011
…exception control flow with logic control flow.
@chrisroberts
Copy link
Owner

Existence check removed. Resolved as of 0.2.8

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

No branches or pull requests

2 participants