From 6fbecaeff346ba540c47877f1baa4828cb815a25 Mon Sep 17 00:00:00 2001 From: Pieter Lexis Date: Wed, 27 Nov 2019 16:39:20 +0100 Subject: [PATCH] API: Accept null as empty list in createZone Some clients refuse to send empty arrays. --- pdns/ws-auth.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 4d21bb5775..e1b29ea6f1 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -1535,8 +1535,8 @@ static void apiServerZones(HttpRequest* req, HttpResponse* resp) { throw ApiException("You cannot give rrsets AND zone data as text"); auto nameservers = document["nameservers"]; - if (!nameservers.is_array() && zonekind != DomainInfo::Slave) - throw ApiException("Nameservers list must be given (but can be empty if NS records are supplied)"); + if (!nameservers.is_null() && !nameservers.is_array() && zonekind != DomainInfo::Slave) + throw ApiException("Nameservers is not a list"); string soa_edit_api_kind; if (document["soa_edit_api"].is_string()) { -- 2.47.2