mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed Security Hotspot reported by SonarQube.
This commit is contained in:
committed by
Akshay Joshi
parent
084203debc
commit
7bd0d55c83
@@ -11,7 +11,6 @@ import urllib3
|
||||
import ipaddress
|
||||
from flask_security import current_user
|
||||
from pgadmin.misc.bgprocess.processes import IProcessDesc
|
||||
from pgadmin.utils import html
|
||||
from pgadmin.model import db, Server
|
||||
from flask_babel import gettext
|
||||
from pgadmin.utils import get_server
|
||||
@@ -19,12 +18,13 @@ from pgadmin.utils import get_server
|
||||
|
||||
def get_my_ip():
|
||||
""" Return the public IP of this host """
|
||||
http = urllib3.PoolManager()
|
||||
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
|
||||
http = urllib3.PoolManager(cert_reqs='CERT_NONE')
|
||||
try:
|
||||
external_ip = http.request('GET', 'http://ifconfig.me/ip').data
|
||||
external_ip = http.request('GET', 'https://ifconfig.me/ip').data
|
||||
except Exception:
|
||||
try:
|
||||
external_ip = http.request('GET', 'http://ident.me').data
|
||||
external_ip = http.request('GET', 'https://ident.me').data
|
||||
except Exception:
|
||||
external_ip = '127.0.0.1'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user