]> granicus.if.org Git - pdns/commitdiff
store masters with comma separated and without trailing space
authorKlaus Darilion <klaus.darilion@nic.at>
Mon, 18 Feb 2019 10:42:16 +0000 (10:42 +0000)
committerKlaus Darilion <klaus.darilion@nic.at>
Mon, 18 Feb 2019 10:42:16 +0000 (10:42 +0000)
pdns/ws-auth.cc

index b2ab3a2d86d064bca416182840d19c68036923b7..8d75ed1c74264834cb0309fb4687be5600400941 100644 (file)
@@ -603,17 +603,17 @@ static void throwUnableToSecure(const DNSName& zonename) {
 }
 
 static void updateDomainSettingsFromDocument(UeberBackend& B, const DomainInfo& di, const DNSName& zonename, const Json document) {
-  string zonemaster;
+  vector<string> zonemaster;
   bool shouldRectify = false;
   for(auto value : document["masters"].array_items()) {
     string master = value.string_value();
     if (master.empty())
       throw ApiException("Master can not be an empty string");
-    zonemaster += master + " ";
+    zonemaster.push_back(master);
   }
 
-  if (zonemaster != "") {
-    di.backend->setMaster(zonename, zonemaster);
+  if (zonemaster.size()) {
+    di.backend->setMaster(zonename, boost::join(zonemaster, ","));
   }
   if (document["kind"].is_string()) {
     di.backend->setKind(zonename, DomainInfo::stringToKind(stringFromJson(document, "kind")));