Skip to content

BugFix(upstream): correct slice index in function tryTrimIpv6Brackets - #939

Open
Akariln wants to merge 1 commit into
IrineSistiana:mainfrom
Akariln:patch-1
Open

BugFix(upstream): correct slice index in function tryTrimIpv6Brackets#939
Akariln wants to merge 1 commit into
IrineSistiana:mainfrom
Akariln:patch-1

Conversation

@Akariln

@Akariln Akariln commented Aug 15, 2026

Copy link
Copy Markdown

The tryTrimIpv6Brackets function in pkg/upstream/utils.go used an incorrect slice end index when removing square brackets from IPv6 literals. Previously, s[1:len(s)-2] truncated the final character (e.g., "[::1]" became "::"). This patch changes the index to len(s)-1, ensuring the complete address is returned.

The `tryTrimIpv6Brackets` function in `pkg/upstream/utils.go` used an incorrect slice end index when removing square brackets from IPv6 literals. Previously, `s[1:len(s)-2]` truncated the final character (e.g., "[::1]" became "::"). This patch changes the index to `len(s)-1`, ensuring the complete address is returned.
@Akariln Akariln changed the title BugFix(upstream) correct slice index in tryTrimIpv6Brackets BugFix(upstream): correct slice index in tryTrimIpv6Brackets Aug 15, 2026
@Akariln Akariln changed the title BugFix(upstream): correct slice index in tryTrimIpv6Brackets BugFix(upstream): correct slice index in function tryTrimIpv6Brackets Aug 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant