diff --git a/website/cue/reference/remap/functions/decode_punycode.cue b/website/cue/reference/remap/functions/decode_punycode.cue index b2d2dde433e86..0f0734e233e6e 100644 --- a/website/cue/reference/remap/functions/decode_punycode.cue +++ b/website/cue/reference/remap/functions/decode_punycode.cue @@ -13,6 +13,13 @@ remap: functions: decode_punycode: { required: true type: ["string"] }, + { + name: "validate" + description: "If enabled, checks if the input string is a valid domain name." + required: false + type: ["boolean"] + default: true + }, ] internal_failure_reasons: [ "`value` is not valid `punycode`", @@ -34,5 +41,12 @@ remap: functions: decode_punycode: { """ return: "www.cafe.com" }, + { + title: "Ignore validation" + source: """ + decode_punycode!("xn--8hbb.xn--fiba.xn--8hbf.xn--eib.", validate: false) + """ + return: "١٠.٦٦.٣٠.٥." + }, ] } diff --git a/website/cue/reference/remap/functions/encode_punycode.cue b/website/cue/reference/remap/functions/encode_punycode.cue index 13e5415f99638..5ca6df5f0a2ba 100644 --- a/website/cue/reference/remap/functions/encode_punycode.cue +++ b/website/cue/reference/remap/functions/encode_punycode.cue @@ -13,6 +13,13 @@ remap: functions: encode_punycode: { required: true type: ["string"] }, + { + name: "validate" + description: "Whether to validate the input string to check if it is a valid domain name." + required: false + type: ["boolean"] + default: true + }, ] internal_failure_reasons: [ "`value` can not be encoded to `punycode`", @@ -41,5 +48,12 @@ remap: functions: encode_punycode: { """ return: "www.cafe.com" }, + { + title: "Ignore validation" + source: """ + encode_punycode!("xn--8hbb.xn--fiba.xn--8hbf.xn--eib.", validate: false) + """ + return: "xn--8hbb.xn--fiba.xn--8hbf.xn--eib." + }, ] }