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 segment wan_ip #430

Merged
merged 3 commits into from
May 31, 2024
Merged

Fix segment wan_ip #430

merged 3 commits into from
May 31, 2024

Conversation

matrixzj
Copy link
Contributor

302 (redirect) response from Akamai. Fix with option -L follow redirect.

* 302 (redirect) response from Akamai. Fix with option `-L` follow redirect.
Copy link
Collaborator

@xx4h xx4h left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reporting, i suggest to directly use the new location (https) so we don't have two requests each run.

@@ -39,7 +39,7 @@ run_segment() {
fi

if [ -z "$wan_ip" ]; then
if wan_ip=$(curl --max-time 2 -s http://whatismyip.akamai.com/); then
if wan_ip=$(curl --max-time 2 -s -L http://whatismyip.akamai.com/); then
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if wan_ip=$(curl --max-time 2 -s -L http://whatismyip.akamai.com/); then
if wan_ip=$(curl --max-time 2 -s https://whatismyip.akamai.com/); then

* 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.
segments/wan_ip.sh Outdated Show resolved Hide resolved
* Fix protocal error for wan-ip url, change from `http` to `https`
@xx4h
Copy link
Collaborator

xx4h commented May 31, 2024

👍 Thank you again for reporting!

@xx4h xx4h merged commit 6aea97f into erikw:main May 31, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants