Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit697b30e

Browse files
committed
Fix equals being lost in SSH config value
This was causing issues with the header flag as those contain equalsigns.
1 parent8193a11 commit697b30e

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

‎.eslintrc.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,13 @@
3535
}],
3636
"import/no-unresolved": ["error", {
3737
"ignore": ["vscode"]
38-
}]
38+
}],
39+
"@typescript-eslint/no-unused-vars": [
40+
"error",
41+
{
42+
"varsIgnorePattern":"^_"
43+
}
44+
]
3945
},
4046
"ignorePatterns": [
4147
"out",

‎src/sshSupport.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,14 @@ it("computes the config for a host", () => {
2929
Host coder-vscode--*
3030
StrictHostKeyChecking no
3131
Another=true
32+
ProxyCommand=/tmp/coder --header="X-FOO=bar" coder.dev
3233
# --- END CODER VSCODE ---
3334
`,
3435
)
3536

3637
expect(properties).toEqual({
3738
Another:"true",
3839
StrictHostKeyChecking:"yes",
40+
ProxyCommand:'/tmp/coder --header="X-FOO=bar" coder.dev',
3941
})
4042
})

‎src/sshSupport.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ export function computeSSHProperties(host: string, config: string): Record<strin
5252
if(line===""){
5353
return
5454
}
55-
const[key, ...valueParts]=line.split(/\s+|=/)
55+
// The capture group here will include the captured portion in the array
56+
// which we need to join them back up with their original values. The first
57+
// separate is ignored since it splits the key and value but is not part of
58+
// the value itself.
59+
const[key,_, ...valueParts]=line.split(/(\s+|=)/)
5660
if(key.startsWith("#")){
5761
// Ignore comments!
5862
return
@@ -62,15 +66,15 @@ export function computeSSHProperties(host: string, config: string): Record<strin
6266
configs.push(currentConfig)
6367
}
6468
currentConfig={
65-
Host:valueParts.join(""),
69+
Host:valueParts.join(""),
6670
properties:{},
6771
}
6872
return
6973
}
7074
if(!currentConfig){
7175
return
7276
}
73-
currentConfig.properties[key]=valueParts.join("")
77+
currentConfig.properties[key]=valueParts.join("")
7478
})
7579
if(currentConfig){
7680
configs.push(currentConfig)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp