The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 14:45 UTC
fix(web): SSH port field no longer turns 22.5 into port 22 (#28297)
Co-authored-by: Julius Marminge <julius0216@outlook.com>
Victor committed
Nov 14, 2026 at 05:50 UTC
ead133ce70eb5302f2f58516bbfb283f2f5ccdfd
2 files changed
+10
-1
apps/web/src/components/settings/ConnectionsSettings.logic.test.ts
+9
@@ -3,6 +3,7 @@ import { describe, expect, it, vi } from "vite-plus/test";
3
import {
4
applyWslEnableSelection,
5
isServerNetworkAccessible,
6
+ parseManualDesktopSshTarget,
7
resolveAccessEnvironmentId,
8
resolveTailscaleServeBaseUrl,
9
selectQrEndpointOption,
@@ -44,6 +45,14 @@ describe("togglePairingScopeSelection", () => {
45
});
46
});
47
48
+describe("parseManualDesktopSshTarget", () => {
49
+ it.each(["22.5", "1e3", "2222garbage"])("rejects explicit port %j", (port) => {
50
+ expect(() => parseManualDesktopSshTarget({ host: "devbox", username: "", port })).toThrow(
51
+ "SSH port must be between 1 and 65535.",
52
+ );
53
+ });
54
+});
55
+
56
describe("resolveTailscaleServeBaseUrl", () => {
57
it.each([
58
["https://host.tail.ts.net:441/", 443, "https://host.tail.ts.net"],
apps/web/src/components/settings/ConnectionsSettings.logic.ts
+1
-1
@@ -214,7 +214,7 @@ export function parseManualDesktopSshTarget(input: {
214
215
const rawPort = input.port.trim();
216
if (rawPort.length > 0) {
217
- port = Number.parseInt(rawPort, 10);
217
+ port = /^\d+$/u.test(rawPort) ? Number.parseInt(rawPort, 10) : Number.NaN;
218
}
219
220
if (hostname.length === 0) {