mirror of
https://github.com/fosrl/newt.git
synced 2026-05-06 16:09:02 -05:00
[PR #253] [MERGED] [ipv6]: Parse target strings support and strict validation #2221
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/fosrl/newt/pull/253
Author: @LaurenceJJones
Created: 3/5/2026
Status: ✅ Merged
Merged: 3/8/2026
Merged by: @oschwartz10612
Base:
dev← Head:investigate-ipv6-support📝 Commits (1)
58d9b89Parse target strings with IPv6 support and strict validation📊 Changes
2 files changed (+262 additions, -16 deletions)
View changed files
📝
common.go(+50 -16)➕
common_test.go(+212 -0)📄 Description
Community Contribution License Agreement
By creating this pull request, I grant the project maintainers an unlimited,
perpetual license to use, modify, and redistribute these contributions under any terms they
choose, including both the AGPLv3 and the Fossorial Commercial license terms. I
represent that I have the right to grant this license for all contributed content.
Description
Add parseTargetString() for listenPort:host:targetPort using net.SplitHostPort/JoinHostPort. Replace manual split in updateTargets; fix err shadowing on remove. Validate listen port 1–65535 and reject empty host/port; use %w for errors. Add tests for IPv4, IPv6, hostnames, and invalid cases.
How to test?
Adding a ipv6 bracketed address in pangolin should result in a valid target added.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.