File tree Expand file tree Collapse file tree
packages/server/src/utils/dns Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -175,8 +175,16 @@ export const cloudflareClient: DnsClient<CloudflareConfig> = {
175175 `/zones/${ record . zoneId } /dns_records?type=${ record . type } &name=${ encodeURIComponent ( record . name ) } ` ,
176176 ) ;
177177
178+ const built = buildValue ( record ) ;
179+ const normalizedRecord = {
180+ type : record . type ,
181+ content : built . content ?? record . content . trim ( ) ,
182+ priority : built . priority ,
183+ } ;
184+ const expectedContent = inlinePriority ( normalizedRecord ) ;
185+
178186 const existingRecord = existing . find (
179- ( r ) => inlinePriority ( r ) === record . content ,
187+ ( r ) => inlinePriority ( r ) === expectedContent ,
180188 ) ;
181189 if ( existingRecord ) {
182190 const updated = await cfFetch < { id : string } > (
Original file line number Diff line number Diff line change @@ -172,11 +172,14 @@ export const infomaniakClient: DnsClient<InfomaniakConfig> = {
172172 async upsertRecord ( config , record ) {
173173 const source = toSource ( record . name , record . zoneId ) ;
174174 const existing = await listZoneRecords ( config , record . zoneId ) ;
175+ const expectedContent = unquoteTarget (
176+ quoteTarget ( record . type , record . content ) ,
177+ ) ;
175178 const match = existing . find (
176179 ( candidate ) =>
177180 candidate . type === record . type &&
178181 normalizeSource ( candidate . source ) === source &&
179- unquoteTarget ( candidate . target ) === record . content ,
182+ unquoteTarget ( candidate . target ) === expectedContent ,
180183 ) ;
181184
182185 const body = JSON . stringify ( recordPayload ( record , record . zoneId ) ) ;
You can’t perform that action at this time.
0 commit comments