dnsimple-node icon indicating copy to clipboard operation
dnsimple-node copied to clipboard

client.zones.updateZoneRecord throws error for URI unsafe DNS record content

Open christianechevarria opened this issue 2 years ago • 3 comments

I'm currently using this client to automatically register & update DNS records with MailGun records automatically -

I've been very successful at creating records using the createZoneRecord function but when I've duplicated the code for updateZoneRecord I am getting this error

DNSimple updateSubdomain Error: TypeError [ERR_UNESCAPED_CHARACTERS]: Request path contains unescaped characters

I've confirmed that creating new domains with DNS records containing URI unsafe characters such as "/" which is the most prevalent works as expected but createZoneRecord for some reason does not

This is fairly problematic for RSA keys generated as _domainkey records (for DKIM)

Do I have to URI encode the values inside the DNS record "content" properties? If so, why is it necessary to do this for updateZoneRecord but not createZoneRecord (my guess is that this is potentially a bug, but I'm not sure)

christianechevarria avatar Jun 02 '22 19:06 christianechevarria

@chrisgereina Thanks for bringing this to our attention!

Upon first glance, I don't see anything that would cause the difference in behaviour between the two methods. I'll review with the team and we'll get back to you.

dallasread avatar Jun 02 '22 23:06 dallasread

👋 @chrisgereina, I know this doesn't answer your question, but could our apply one-click service endpoint help you?

Quick intro: one-click services are DNS snippets ready to be applied to a domain/zone. These are available through our UI and API.

Here is an article that explains how to use the Mailgun one-click service through our UI. Through our API, you would use the list service endpoint to retrieve the Mailgun one-click service, and use this endpoint to apply the one-click service to your domain/zone.

I hope this helps. Are you doing something specific that cannot be done through the one-click service?

Let us know!

sbastn avatar Jun 06 '22 13:06 sbastn

Hey @christianechevarria, thanks for reporting this. It's been a while, but maybe you can provide the call you are making from the client so we can reproduce this? I have tried myself but I have not been able to.

jacegu avatar Sep 19 '22 14:09 jacegu

Closing as stale. Please respond to this issue to reopen with reproduction steps.

DXTimer avatar Mar 01 '23 10:03 DXTimer