public inbox for pmg-devel@lists.proxmox.com
 help / color / mirror / Atom feed
From: Gabriel Goller <g.goller@proxmox.com>
To: pmg-devel@lists.proxmox.com
Subject: [PATCH api] pmgbanner: fix URL IPv6 address formatting
Date: Tue,  9 Jun 2026 10:35:16 +0200	[thread overview]
Message-ID: <20260609083520.41275-1-g.goller@proxmox.com> (raw)

Wrap IPv6 local IP address in brackets when generating the web UI
URL. Otherwise browsers (firefox and chromium tested) can't tell the
difference between port and ipv6 address segment.

Similar to the PVE patch:
https://lore.proxmox.com/20260511093554.102397-1-g.goller@proxmox.com

Signed-off-by: Gabriel Goller <g.goller@proxmox.com>
---
 src/bin/pmgbanner | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/bin/pmgbanner b/src/bin/pmgbanner
index 715db99e8fb9..0d442c8b0ed9 100755
--- a/src/bin/pmgbanner
+++ b/src/bin/pmgbanner
@@ -28,7 +28,8 @@ for (my $try = 1; $try <= 15; $try++) {
 
 $addr //= '<unknown>'; # useless but we must _not_ fail here
 
-$banner .= "  https://${addr}:8006/\n";
+my $urlip = $addr =~ m/:/ ? "[$addr]" : $addr;
+$banner .= "  https://${urlip}:8006/\n";
 
 $banner .= "\n$xline\n\n";
 
-- 
2.47.3





             reply	other threads:[~2026-06-09  8:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-09  8:35 Gabriel Goller [this message]
2026-06-09  9:30 ` applied: [PATCH api] pmgbanner: fix URL IPv6 address formatting Stoiko Ivanov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260609083520.41275-1-g.goller@proxmox.com \
    --to=g.goller@proxmox.com \
    --cc=pmg-devel@lists.proxmox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal