-
Notifications
You must be signed in to change notification settings - Fork 322
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
icanhazip.com broken on ipv4 IP updates #635
Comments
One way to work around this is using the web-skip parameter to skip part of the reply. I tried setting it to \n\n to skip the HTTP headers and it worked for me: $ ddclient -query -web ipv4.icanhazip.com -web-skip='\n\n'
----- Test_possible_ip with 'get_ip' -----
...
use=web, web=ipv4.icanhazip.com address is 84.xxx.xxx.xxx
...
It might make sense to change the default skip value to that. I'd assume most IP querying sites will return the IP in the HTTP body, not the headers - and IPs in headers could always happen. |
Thank you for that @LenardHess |
I couldn't get this to work with the ddclient.conf file, so ended up swapping to use https://api.ipify.org/ instead;
|
I just wanted to chime in and say that I also experienced this issue; it gave me a tiny heart attack because 1.0.1.1 seems to be a Chinese IP and I'd thought my security had been compromised. |
I was able to add
|
I prefer handling the content directly rather than relying on potentially volatile patterns in this scenario :
|
It appears that Cloudflare (who hosts icanhazip.com) recently updated their Set-Cookie headers to include a substring that matches the IPv4 regex. This is not always present as of this writing, but the vast majority of responses include it.
Example response:
Since the
extract_ipv4
function searches for the "first valid IPv4 address in the given string" and the string includes the headers, this causes it to set the IP to1.0.1.1
rather than the returned value in the body of the HTTP response.IPv6 is unaffected since the regex doesn't match, but the same potential for future issues is present.
The text was updated successfully, but these errors were encountered: