Skip to content

Commit 3799c1c

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 9561fff commit 3799c1c

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
@@ -123,7 +123,7 @@
123123
},
124124
{
125125
"command": "dev-proxy-toolkit.start-with-options",
126-
"group": "navigation@1",
126+
"group": "navigation@2",
127127
"when": "!activeEditorIsDirty && isDevProxyConfigFile && !isDevProxyRunning"
128128
},
129129
{

src/commands/proxy.ts

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

257257
// Watch PIDs
258258
const watchPids = await vscode.window.showInputBox({
259-
title: 'Start with Options (13/13): Watch PIDs and process names',
259+
title: 'Start with Options (13/13): Watch PIDs',
260260
prompt: 'Enter process IDs to watch (space separated). Leave empty to skip.',
261261
placeHolder: '1234 5678',
262262
value: '',
@@ -304,9 +304,16 @@ function validateIpAddress(value: string): string | undefined {
304304
if (!value) {
305305
return undefined;
306306
}
307-
if (!/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(value)) {
307+
const parts = value.split('.');
308+
if (parts.length !== 4) {
308309
return 'Enter a valid IPv4 address (e.g. 127.0.0.1)';
309310
}
311+
for (const part of parts) {
312+
const num = Number(part);
313+
if (!/^\d{1,3}$/.test(part) || num < 0 || num > 255) {
314+
return 'Enter a valid IPv4 address (e.g. 127.0.0.1)';
315+
}
316+
}
310317
return undefined;
311318
}
312319

0 commit comments

Comments
 (0)