From 64a36f0d5ad9b6fdcdf4e7e997ba95f657ea0363 Mon Sep 17 00:00:00 2001 From: Christian Hofstaedtler Date: Tue, 24 Jun 2014 12:56:50 +0200 Subject: [PATCH] Send status 201 on create --- pdns/ws-auth.cc | 1 + pdns/ws-recursor.cc | 1 + regression-tests.api/test_Zones.py | 1 + 3 files changed, 3 insertions(+) diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 70238530cb..dc0f459484 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -667,6 +667,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) { di.backend->commitTransaction(); fillZone(zonename, resp); + resp->status = 201; return; } diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index 9da97273f3..c5593c666b 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -293,6 +293,7 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) doCreateZone(document); reloadAuthAndForwards(); fillZone(zonename, resp); + resp->status = 201; return; } diff --git a/regression-tests.api/test_Zones.py b/regression-tests.api/test_Zones.py index cc61b3ab1b..113f41af39 100644 --- a/regression-tests.api/test_Zones.py +++ b/regression-tests.api/test_Zones.py @@ -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): -- 2.47.2