Closed (fixed)
Project:
RESTful Web Services
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
28 Mar 2012 at 09:36 UTC
Updated:
18 Jun 2012 at 12:41 UTC
Jump to comment: Most recent file
Comments
Comment #1
sepgil commentedI made a patch, which fixes this issue and also added a test to test the new functionality. However I'm not sure if I'm returning the right HTTP status code(currently 406 Not Acceptable). Would it be better to use 400 Bad Request.
Btw: I also fixed 2 spelling errors I found in some comments.
Comment #2
klausiinline if statements are not allowed, always use "{}"
That comment does not really fit, shouldn't it be "Test bad creation request with missing bundle key"?
I think you should also check that loading the node by the title does not return any result (after the request).
I'm not sure about 400 vs. 406. 400 says that the syntax is malformed, which is not the case here. On the other hand 406 says that the request does not conform to the accept headers, so this seems wrong, too.
Comment #3
sepgil commentedI wanted a general comment & title, in case we want to add more tests to this function. I renamed it to testBadRequests.
I've fixed the other 2 issues to in the new patch.
There seems to be no appropriate status code for it, so maybe should keep 406 for now...
Comment #4
klausiCommitted, thanks! http://drupalcode.org/project/restws.git/commit/2318d17