From: Pieter Lexis Date: Wed, 27 Nov 2019 15:39:20 +0000 (+0100) Subject: API: Accept null as empty list in createZone X-Git-Tag: auth-4.3.0-alpha1~11^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F8585%2Fhead;p=thirdparty%2Fpdns.git API: Accept null as empty list in createZone Some clients refuse to send empty arrays. --- 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()) {