fix: ipv6 support for sidebar links (#56)

* added ipv6 support for sidebar links

* typo

---------

Co-authored-by: anonymous <anonymous>
This commit is contained in:
stacksmash76 2023-12-23 18:00:58 +01:00 committed by GitHub
parent d302facf51
commit 412a5c4f86
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,7 +76,12 @@ def generate_page_list(user):
else:
locks = os.listdir('/install')
try:
host = request.host.split(":")[0]
if "[" in request.host:
# Special case to handle IPv6 addresses
host = request.host.split("]:")[0]
else:
# Handle IPv4 addresses
host = request.host.split(":")[0]
except:
host = request.host