Closed
Bug 736132
Opened 13 years ago
Closed 13 years ago
HTTP compliance: Ensure all PUT methods return 201 when a new record is created in the database
Categories
(Cloud Services Graveyard :: Server: Sync, defect)
Tracking
(Not tracked)
VERIFIED
FIXED
People
(Reporter: Atoll, Assigned: rfkelly)
References
Details
(Whiteboard: [qa+])
Attachments
(2 files)
3.88 KB,
patch
|
telliott
:
review+
|
Details | Diff | Splinter Review |
2.05 KB,
patch
|
Details | Diff | Splinter Review |
We currently return 200 when a new row is created in the database, which is illegal.
9.6 PUT
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.
Updated•13 years ago
|
Whiteboard: [qa+]
Assignee | ||
Comment 1•13 years ago
|
||
Here's the necessary code. Also needs a doc update before this bug can be closed.
Attachment #607845 -
Flags: review?(telliott)
Comment 2•13 years ago
|
||
Comment on attachment 607845 [details] [diff] [review]
patch to return 201 when a new item is created
Having to do two calls here is frowny, but at least they're very fast (and live in production right now, so clearly OK). Otherwise, looks good.
Attachment #607845 -
Flags: review?(telliott) → review+
Assignee | ||
Comment 3•13 years ago
|
||
Committed in https://github.com/mozilla-services/server-syncstorage/commit/a3203cbd70e06410fe1016e6ac78ba830f21a4af
Leaving bug open as a reminder to do the docs patch.
Assignee | ||
Comment 4•13 years ago
|
||
Here's the corresponding docs patch for posterity
Assignee: nobody → rkelly
Assignee | ||
Comment 5•13 years ago
|
||
Closing this bug since it now works as required by the spec. The ability to differentiate "created" vs "updated" with a single database call will come about when we implement "on duplicate key" handling as described in Bug 691315.
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Comment 6•13 years ago
|
||
:atoll or :rfkelly - what QA work is needed here to verify this fix (or is any needed)?
(In reply to James Bonacci [:jbonacci] from comment #6)
> :atoll or :rfkelly - what QA work is needed here to verify this fix (or is
> any needed)?
I think you will need to test the PUT api calls and ensure they return 201, rather than 200, in various scenarios.
:rfkelly would be able to indicate which scenarios.
Assignee | ||
Comment 8•13 years ago
|
||
(In reply to James Bonacci [:jbonacci] from comment #6)
> :atoll or :rfkelly - what QA work is needed here to verify this fix (or is
> any needed)?
The API only has a single PUT request, for uploading a BSO. The patch for this bug includes an API testcase that exercises it. So, if you're happy that the test looks right, and the functional testsuite continues to run OK, then we should be all good.
Comment 9•13 years ago
|
||
Indeed, a new pull of the Sync 2.0 and AITC 1.0 code yields clean functional test runs.
Status: RESOLVED → VERIFIED
Updated•2 years ago
|
Product: Cloud Services → Cloud Services Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•