Skip to content

Commit f525072

Browse files
committed
Prefix IPv6 WEBIRC addresses with 0 rather than [wrapping] them
1 parent 6fa5ea8 commit f525072

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pkg/webircgateway/client.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,10 @@ func (c *Client) connectUpstream() {
334334
}
335335

336336
remoteAddr := client.RemoteAddr
337-
// Wrap IPv6 addresses so they can be sent as an individual IRC parameter
338-
// eg. ::1 would not parse correctly as a parameter, while [::1] will
339-
if strings.Contains(remoteAddr, ":") {
340-
remoteAddr = "[" + remoteAddr + "]"
337+
// Prefix IPv6 addresses that start with a : so they can be sent as an individual IRC
338+
// parameter. eg. ::1 would not parse correctly as a parameter, while 0::1 will
339+
if strings.HasPrefix(remoteAddr, ":") {
340+
remoteAddr = "0" + remoteAddr
341341
}
342342

343343
webircLine := fmt.Sprintf(

0 commit comments

Comments
 (0)