gstuartj / cf-ddns.sh

A simple client for automatically updating CloudFlare DNS with your current IP address
MIT License
81 stars 35 forks source link

Fix // in URL which breaks Cloudflare API since April 2020 #10

Open fgagne opened 4 years ago

fgagne commented 4 years ago

The previous form ${storage_dir%%+(/)} and ${cf_api_url%%+(/)} ain't working on my prod env, It probably needs the extglob option which ain't enabled by default. This cause // in url which cause problem with Couldflare API since about mid April 2020.

Solution: just remove the last trailing slash.

jdkelleher commented 4 years ago

I hadn't realized there was a Cloudflare issue until I saw this pull request and tested.

Before patch

{
  "result": null,
  "success": false,
  "errors": [
    {
      "code": 7000,
      "message": "No route for that URI"
    }
  ],
  "messages": []
}

After patch

Record updated.

Looks good to me and thank you for the reminder to not throw away return codes.