Ensure that pgAdmin routes should have the SCRIPT_NAME prefix. #5344
parent
80f897a513
commit
cc6ee1ddd2
|
@ -123,21 +123,13 @@ class PgAdmin(Flask):
|
|||
# like 'localhost/pgadmin4' then we have to append '/pgadmin4'
|
||||
# into endpoints
|
||||
#############################################################
|
||||
import config
|
||||
is_wsgi_root_present = False
|
||||
if config.SERVER_MODE:
|
||||
pgadmin_root_path = url_for('browser.index')
|
||||
if pgadmin_root_path != '/browser/':
|
||||
is_wsgi_root_present = True
|
||||
wsgi_root_path = pgadmin_root_path.replace(
|
||||
'/browser/', ''
|
||||
)
|
||||
wsgi_root_path = current_app.config.get("APPLICATION_ROOT", "/")
|
||||
|
||||
def get_full_url_path(url):
|
||||
"""
|
||||
Generate endpoint URL at per WSGI alias
|
||||
"""
|
||||
if is_wsgi_root_present and url:
|
||||
if wsgi_root_path != "/" and url:
|
||||
return wsgi_root_path + url
|
||||
else:
|
||||
return url
|
||||
|
|
Loading…
Reference in New Issue