Skip to content

Commit 48d0f19

Browse files
authored
Trim whitespaces before adding custom DNS record (#3569)
2 parents 6023387 + ac7b984 commit 48d0f19

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/js/settings-dns-records.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ $(() => {
215215

216216
$("#btnAdd-host").on("click", () => {
217217
utils.disableAll();
218-
const elem = $("#Hip").val() + " " + $("#Hdomain").val();
218+
const elem = $("#Hip").val().trim() + " " + $("#Hdomain").val().trim();
219219
const url = document.body.dataset.apiurl + "/config/dns/hosts/" + encodeURIComponent(elem);
220220
utils.showAlert("info", "", "Adding DNS record...", elem);
221221
$.ajax({
@@ -239,7 +239,7 @@ $(() => {
239239

240240
$("#btnAdd-cname").on("click", () => {
241241
utils.disableAll();
242-
let elem = $("#Cdomain").val() + "," + $("#Ctarget").val();
242+
let elem = $("#Cdomain").val().trim() + "," + $("#Ctarget").val().trim();
243243
const ttlVal = Number.parseInt($("#Cttl").val(), 10);
244244
// TODO Fix eslint
245245
// eslint-disable-next-line unicorn/prefer-number-properties

0 commit comments

Comments
 (0)