Skip to content

Commit

Permalink
Update internal/publicip/ipinfo/fetch.go
Browse files Browse the repository at this point in the history
  • Loading branch information
qdm12 committed Sep 13, 2023
1 parent c29b23e commit 0e7383c
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions internal/publicip/ipinfo/fetch.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,9 @@ func (f *Fetch) FetchInfo(ctx context.Context, ip netip.Addr) (
url := "https://ipinfo.io/"
switch {
case ip.Is6():
{
url = "https://v6.ipinfo.io/" + ip.String()
}
url = "https://v6.ipinfo.io/" + ip.String()
case ip.Is4():
{
url = "https://ipinfo.io/" + ip.String()
}
url = "https://ipinfo.io/" + ip.String()
}

request, err := http.NewRequestWithContext(ctx, http.MethodGet, url, nil)
Expand Down

0 comments on commit 0e7383c

Please sign in to comment.