API: Make ns.cloud.purchaseServer() and ns.cloud.deleteServer() use hostname as provided (#2560)

This commit is contained in:
catloversg
2026-03-09 03:57:13 +07:00
committed by GitHub
parent e329082a48
commit 342dea77fa
4 changed files with 13 additions and 6 deletions
+3 -1
View File
@@ -30,7 +30,9 @@ export function PurchaseServerModal(props: IProps): React.ReactElement {
}
function onChange(event: React.ChangeEvent<HTMLInputElement>): void {
setHostname(event.target.value);
// Players may accidentally include whitespace in the hostname and later wonder why they cannot use the cloud APIs.
// For example, they intend the hostname to be "foobar", but type "foobar " or "foo bar" instead.
setHostname(event.target.value.replace(/\s+/g, ""));
}
return (