openssh: make option parsing case insensitive - #5559

This commit is contained in:
Eugene Pankov 2022-01-28 22:57:14 +01:00
parent 9e9066d3cd
commit 3466d42cb1
No known key found for this signature in database
GPG Key ID: 5896FCBBDD1CF4F4

View File

@ -89,15 +89,16 @@ export class OpenSSHImporter extends SSHProfileImporter {
})
} else {
const mappedKey = {
Hostname: 'host',
Port: 'port',
User: 'user',
ForwardX11: 'x11',
ServerAliveInterval: 'keepaliveInterval',
ServerAliveCountMax: 'keepaliveCountMax',
ProxyCommand: 'proxyCommand',
ProxyJump: 'jumpHost',
}[key]
hostname: 'host',
host: 'host',
port: 'port',
user: 'user',
forwardx11: 'x11',
serveraliveinterval: 'keepaliveInterval',
serveralivecountmax: 'keepaliveCountMax',
proxycommand: 'proxyCommand',
proxyjump: 'jumpHost',
}[key.toLowerCase()]
if (mappedKey) {
target[mappedKey] = value
}