mirror of
https://github.com/NetworkCats/rustyip.git
synced 2026-11-14 00:15:13 +00:00
fix: skip alt-IP detection when querying another IP address
The detectAltIp() function was unconditionally fetching the viewer's own IPv6/IPv4 address and displaying it alongside queried IP results. Pass the is_query flag to the client via a data attribute and guard the alt-IP detection so it only runs when viewing your own IP.
This commit is contained in:
+3
-1
@@ -320,5 +320,7 @@ function initCopyIp(wrap){
|
||||
}
|
||||
}
|
||||
|
||||
detectAltIp();
|
||||
if(!root.hasAttribute("data-is-query")){
|
||||
detectAltIp();
|
||||
}
|
||||
})();
|
||||
|
||||
@@ -67,6 +67,7 @@
|
||||
<div itemscope itemtype="https://schema.org/WebPage"
|
||||
data-ipv4-domain="{{ ipv4_domain }}"
|
||||
data-copied-text="{{ t_copied }}"
|
||||
{% if is_query %}data-is-query="true"{% endif %}
|
||||
id="ip-info-root">
|
||||
<div class="ip-copy-wrap" data-copied="{{ t_copied }}">
|
||||
<h1 class="ip-display" itemprop="name">{{ ip }}</h1>
|
||||
|
||||
Reference in New Issue
Block a user