Refuse a signed PORT such as +9090
check / check (push) Successful in 2m42s

strconv.Atoi accepts a leading sign, so PORT=+9090 passed the check
while the image's health check put "+9090" into its URL and failed.
PORT is now parsed with strconv.ParseUint, which accepts only plain
digits.

Model: opus-5-5
This commit is contained in:
2026-09-28 17:45:20 +00:00
parent b305942e5e
commit 9024e8c16c
2 changed files with 4 additions and 3 deletions
+1 -1
View File
@@ -31,7 +31,7 @@ func TestNewReadsPort(t *testing.T) {
}
func TestNewRefusesInvalidPort(t *testing.T) {
for _, value := range []string{"0", "65536", "-1", "http", "80.5"} {
for _, value := range []string{"0", "65536", "-1", "+9090", "http", "80.5"} {
t.Run(value, func(t *testing.T) {
t.Setenv("PORT", value)
t.Setenv("XDG_DATA_HOME", "")