fix: validate port range 1-65535 in parsePortValues (closes #25) #30
No reviewers
Labels
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sneak/upaas#30
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch ":fix/port-validation-upper-bound"
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?
Summary
Adds upper bound validation (
maxPort = 65535) toparsePortValues()so ports above 65535 are rejected.Changes
internal/handlers/app.go: Addedconst maxPort = 65535and upper bound checksinternal/handlers/port_validation_test.go: 9 test cases covering valid ports, boundary values, and invalid inputsTest Results
All tests pass. See comments for FAIL (before fix) and PASS (after fix) output.
Before fix — tests FAIL (ports > 65535 incorrectly accepted):
After fix — all tests PASS:
Full
make testpasses with no failures across all packages.