Skip to content

Commit c7d3f5e

Browse files
Copilotgarrytrinder
andcommitted
Address code review: fix title, IP validation, menu ordering
Co-authored-by: garrytrinder <11563347+garrytrinder@users.noreply.github.com>
1 parent bb4beb0 commit c7d3f5e

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@
129129
},
130130
{
131131
"command": "dev-proxy-toolkit.start-with-options",
132-
"group": "navigation@1",
132+
"group": "navigation@2",
133133
"when": "!activeEditorIsDirty && isDevProxyConfigFile && !isDevProxyRunning"
134134
},
135135
{

src/commands/proxy.ts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ async function startDevProxyWithOptions(devProxyExe: string): Promise<void> {
258258

259259
// Watch PIDs
260260
const watchPids = await vscode.window.showInputBox({
261-
title: 'Start with Options (13/13): Watch PIDs and process names',
261+
title: 'Start with Options (13/13): Watch PIDs',
262262
prompt: 'Enter process IDs to watch (space separated). Leave empty to skip.',
263263
placeHolder: '1234 5678',
264264
value: '',
@@ -306,9 +306,16 @@ function validateIpAddress(value: string): string | undefined {
306306
if (!value) {
307307
return undefined;
308308
}
309-
if (!/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(value)) {
309+
const parts = value.split('.');
310+
if (parts.length !== 4) {
310311
return 'Enter a valid IPv4 address (e.g. 127.0.0.1)';
311312
}
313+
for (const part of parts) {
314+
const num = Number(part);
315+
if (!/^\d{1,3}$/.test(part) || num < 0 || num > 255) {
316+
return 'Enter a valid IPv4 address (e.g. 127.0.0.1)';
317+
}
318+
}
312319
return undefined;
313320
}
314321

0 commit comments

Comments
 (0)