From b5c9233ec4aafec7d8cdd98157f21afa25e91397 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Mon, 13 Nov 2017 14:12:30 +0100 Subject: [PATCH] Revert "API: url in zone info should be absolute" This reverts commit 9df0238e1b567cdd7c48185b00160fb952c3e9f4. See #5030 --- pdns/ws-auth.cc | 2 +- regression-tests.api/test_Zones.py | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index e3d0ac96f6..c1fb9fad1b 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -311,7 +311,7 @@ static Json::object getZoneInfo(const DomainInfo& di) { return Json::object { // id is the canonical lookup key, which doesn't actually match the name (in some cases) { "id", zoneId }, - { "url", "/api/v1/servers/localhost/zones/" + zoneId }, + { "url", "api/v1/servers/localhost/zones/" + zoneId }, { "name", di.zone.toString() }, { "kind", di.getKindString() }, { "dnssec", dk.isSecuredZone(di.zone) }, diff --git a/regression-tests.api/test_Zones.py b/regression-tests.api/test_Zones.py index 5ebb4d1624..72aa59e480 100644 --- a/regression-tests.api/test_Zones.py +++ b/regression-tests.api/test_Zones.py @@ -337,13 +337,6 @@ class AuthZones(ApiTestCase, AuthZonesHelperMixin): headers={'content-type': 'application/json'}) self.assertEquals(r.status_code, 422) - def test_zone_absolute_url(self): - name, payload, data = self.create_zone() - r = self.session.get(self.url("/api/v1/servers/localhost/zones")) - rdata = r.json() - print(rdata[0]) - self.assertTrue(rdata[0]['url'].startswith('/api/v')) - def test_create_slave_zone(self): # Test that nameservers can be absent for slave zones. name, payload, data = self.create_zone(kind='Slave', nameservers=None, masters=['127.0.0.2']) -- 2.47.2