Skip to content

fix(supervisor): validate HostPort digits and range instead of bare parseInt - #390

Open
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/supervisor-hostport-validation
Open

fix(supervisor): validate HostPort digits and range instead of bare parseInt#390
Ayush7614 wants to merge 1 commit into
CopilotKit:mainfrom
Ayush7614:fix/supervisor-hostport-validation

Conversation

@Ayush7614

Copy link
Copy Markdown
Contributor

inspectOwned passed Docker's HostPort string straight into Number.parseInt: "abc" became a NaN port, "0" and out-of-range values were reported as ports nothing can dial, and the listOwned path (numeric PublicPort) disagreed with it.

Adds an exported parseHostPort helper that only accepts digit strings in 1-65535 and omits anything else, and uses it in inspectOwned. Verified with a 13-case script plus supervisor typecheck and the 14 existing listen-port/memory-bytes/names tests green.

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