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

Non-standards compliant PUT response code #49

Open
GoogleCodeExporter opened this issue Apr 28, 2015 · 0 comments
Open

Non-standards compliant PUT response code #49

GoogleCodeExporter opened this issue Apr 28, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

I've been debugging a webdav application used internally at the place where I 
work. To verify correct behaviour I used PyWebDAV. Now I'm suspecting PyWebDAV 
is not fully standards compliant. Please correct me if I'm wrong!

What steps will reproduce the problem?

1. Start PyWebDAV mounted to an empty folder:
$ rm -fr repos && mkdir repos && davserver -D repos -n -J

2. Upload first one file. I do this using the "nd" command line utility: 
$ nd -p arandomfile.txt http://localhost:8008/uploadedfile.txt

Notice how PyWebDAV returns a status code 201 (Created). This is correct 
behaviour (since the file didn't exist before, it was created).

3. Upload a second (different) file: nd -p anotherrandomfile.txt 
http://localhost:8008/uploadedfile.txt

Notice how PyWebDAV returns a status code 201 (Created). According to RFC 
2518[1], no specific HTTP response codes are defined for PUTs. However, if you 
can backtrack to RFC 2068[2] it states that "If a new resource is created, the 
origin server MUST inform the user agent via the 201 (Created) response.  If an 
existing resource is modified, either the 200 (OK) or 204 (No Content) response 
codes SHOULD be sent to indicate successful completion of the request.".

Expected outcome: Since the second put done in (3) above is not creating the 
file, but rather modifying it, I would expect pywebdav to return either a 200 
or a 204.

[1] https://tools.ietf.org/html/rfc2518#page-36
[2] https://tools.ietf.org/html/rfc2068#page-52

What version of the product are you using? On what operating system?

PyWebDAV 0.9.8 (just recently) installed through pip. I'm running Ubuntu Linux 
Lucid Lynx 10.04 LTS.

Please provide any additional information below.

I have no idea whether 200 or 204 response code is to be preferred. I'd love to 
know.

Original issue reported on code.google.com by [email protected] on 29 May 2012 at 2:51

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

No branches or pull requests

1 participant