Updated backend to properly encode the zone name sent to PDNS API so that zones with URL unsafe characters don't break the request.

This commit is contained in:
Matt Scott
2023-11-24 09:49:40 -05:00
parent 48f7f2d19f
commit 18f38fd1ca
2 changed files with 18 additions and 7 deletions

View File

@ -30,14 +30,14 @@ function applyChanges(data, url, showResult, refreshPage) {
function applyRecordChanges(data, domain) {
$.ajax({
type : "POST",
url : $SCRIPT_ROOT + '/domain/' + domain + '/apply',
url : $SCRIPT_ROOT + '/domain/' + encodeURIComponent(domain) + '/apply',
data : JSON.stringify(data),// now data come in this function
contentType : "application/json; charset=utf-8",
crossDomain : true,
dataType : "json",
success : function(data, status, jqXHR) {
// update Apply button value
$.getJSON($SCRIPT_ROOT + '/domain/' + domain + '/info', function(data) {
$.getJSON($SCRIPT_ROOT + '/domain/' + encodeURIComponent(domain) + '/info', function(data) {
$(".button_apply_changes").val(data['serial']);
});