]> granicus.if.org Git - pdns/commitdiff
Send status 201 on create
authorChristian Hofstaedtler <christian@hofstaedtler.name>
Tue, 24 Jun 2014 10:56:50 +0000 (12:56 +0200)
committerChristian Hofstaedtler <christian@hofstaedtler.name>
Tue, 24 Jun 2014 10:56:50 +0000 (12:56 +0200)
pdns/ws-auth.cc
pdns/ws-recursor.cc
regression-tests.api/test_Zones.py

index 70238530cb31bbf52c28822f88312f4157520e37..dc0f459484d078f2edde310b0127fbccb083c511 100644 (file)
@@ -667,6 +667,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) {
     di.backend->commitTransaction();
 
     fillZone(zonename, resp);
+    resp->status = 201;
     return;
   }
 
index 9da97273f3bc3e2a496b4bd3a2e049d18134673c..c5593c666b89205b70c2242925df7558a184e016 100644 (file)
@@ -293,6 +293,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp)
     doCreateZone(document);
     reloadAuthAndForwards();
     fillZone(zonename, resp);
+    resp->status = 201;
     return;
   }
 
index cc61b3ab1bcf5fd5b6c165f9c2150f2e525baa7f..113f41af3903e95e9f4589f1bcd5ec3000f24159 100644 (file)
@@ -44,6 +44,7 @@ class AuthZones(ApiTestCase):
             data=json.dumps(payload),
             headers={'content-type': 'application/json'})
         self.assert_success_json(r)
+        self.assertEquals(r.status_code, 201)
         return payload, r.json()
 
     def test_create_zone(self):