Closed Bug 693864 Opened 13 years ago Closed 13 years ago

Implement /storage DELETE handling in test JS Sync server

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10

People

(Reporter: rnewman, Assigned: rnewman)

Details

(Whiteboard: [fixed in services][qa-])

Attachments

(1 file)

      No description provided.
One TODO, which is to define the behavior when you submit a non-DELETE request to /storage. I contend that the response should be a 405, and I have included a test for this.
Attachment #566451 - Flags: review?(philipp)
Comment on attachment 566451 [details] [diff] [review]
Proposed patch. v1

>   toplevelHandlers: {
>     "storage": function handleStorage(handler, req, resp, version, username, rest) {
>+      let respond = this.respond.bind(this, req, resp);
>+      if (!rest || !rest.length) {
>+        this._log.debug("SyncServer: top-level storage " +
>+                        req.method + " request.");
>+
>+        // TODO: verify if this is spec-compliant.
>+        if (req.method != "DELETE") {
>+          respond(405, "Method Not Allowed", "[]", {"Allow": "DELETE"});
>+          return;
>+        }

Spec is vague about this, but I bet the server does a 404. I do agree that 405 would be better. Follow up with a spec clarification bug?

>   s.start(8080, function () {
>     retrieveWBONotExists(
>-      retrieveWBOExists.bind(this, function () {
>-        s.stop(run_next_test);
>-      })
>-    );
>+      retrieveWBOExists.bind(this,
>+        getStorageFails.bind(this,
>+          deleteStorage.bind(this, function () {
>+            s.stop(run_next_test);
>+          }))));
>   });

Callback-tastic.
Attachment #566451 - Flags: review?(philipp) → review+
See Bug 694129 for the 405 issue.
https://hg.mozilla.org/mozilla-central/rev/2c9b36620889
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
Component: Firefox Sync: Backend → Sync
Product: Cloud Services → Firefox
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: