cf-ddns.sh
cf-ddns.sh copied to clipboard
Fix // in URL which breaks Cloudflare API since April 2020
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.
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.