Fix visit content server in browser not working when the content server is configured to listen on an IPv6 interface. Fixes #2023737 [[Bug] When set content server to listen on IPv4 and IPv6 address, Calibre won't launch broswer when Click "Visit content server in broswer"](https://bugs.launchpad.net/calibre/+bug/2023737)

This commit is contained in:
Kovid Goyal 2023-07-26 11:18:59 +05:30
parent bdf0999304
commit ffcaf382a2
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -23,6 +23,8 @@ def local_url_for_content_server():
protocol = 'https' if opts.ssl_certfile and opts.ssl_keyfile else 'http'
prefix = opts.url_prefix or ''
port = opts.port
if ':' in interface:
interface = f'[{interface}]'
return f'{protocol}://{interface}:{port}{prefix}'