Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix // problem with Cloudflare API
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 enable by default. This cause // in url which cause problem with Couldflare API since about mid April 2020.

Solution: just remove the last trailing slash.
fgagne authored May 22, 2020

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit 9e9199b1e5853ee215e2426fb6531152c2fd88be
6 changes: 3 additions & 3 deletions cf-ddns.sh
Original file line number Diff line number Diff line change
@@ -290,9 +290,9 @@ do_record_update () {

#Main
###############
# Remove any trailing slashes from storage_dir and cf_api_url
storage_dir=${storage_dir%%+(/)}
cf_api_url=${cf_api_url%%+(/)}
# Remove the last trailing slash from storage_dir and cf_api_url
storage_dir=${storage_dir%/}
cf_api_url=${cf_api_url%/}

# Show help and exit if no option was passed in the command line