From: Christian Hofstaedtler Date: Tue, 24 Jun 2014 10:56:50 +0000 (+0200) Subject: Send status 201 on create X-Git-Tag: auth-3.4.0-rc1~122^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F1486%2Fhead;p=thirdparty%2Fpdns.git Send status 201 on create --- 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):