Skip to content

Commit

Permalink
Fix segment wan_ip
Browse files Browse the repository at this point in the history
* 302 (redirect) response from Akamai while using HTTP. Fix with `-L` follow redirect.
* Use `HTTPS` instead of `HTTP` enhance security, and avoid 2 requests to be made.
  • Loading branch information
matrixzj committed May 31, 2024
1 parent b77186f commit a8ac60a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion segments/wan_ip.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ run_segment() {
fi

if [ -z "$wan_ip" ]; then
if wan_ip=$(curl --max-time 2 -s -L http://whatismyip.akamai.com/); then
if wan_ip=$(curl --max-time 2 -s -L https://whatismyip.akamai.com/); then
echo "${wan_ip}" >"$tmp_file"
elif [ -f "${tmp_file}" ]; then
wan_ip=$(cat "$tmp_file")
Expand Down

0 comments on commit a8ac60a

Please sign in to comment.