@@ -596,7 +596,35 @@ func TestConfigSSH_FileWriteAndOptionsFlow(t *testing.T) {
596
596
ProvisionApply : echo .ProvisionApplyWithAgent ("" ),
597
597
},
598
598
wantConfig : wantConfig {
599
- regexMatch : "--header-command /foo/bar/coder ssh" ,
599
+ regexMatch : "--header-command \" /foo/bar/coder\" ssh" ,
600
+ },
601
+ },
602
+ {
603
+ name : "Header command with double quotes" ,
604
+ args : []string {
605
+ "--header-command" , "/foo/bar/coder arg1 arg2=\" quoted value\" " ,
606
+ },
607
+ wantErr : false ,
608
+ echoResponse : & echo.Responses {
609
+ Parse : echo .ParseComplete ,
610
+ ProvisionApply : echo .ProvisionApplyWithAgent ("" ),
611
+ },
612
+ wantConfig : wantConfig {
613
+ regexMatch : "--header-command \" /foo/bar/coder arg1 arg2=\\ \" quoted value\\ \" \" ssh" ,
614
+ },
615
+ },
616
+ {
617
+ name : "Header command with single quotes" ,
618
+ args : []string {
619
+ "--header-command" , "/foo/bar/coder arg1 arg2='quoted value'" ,
620
+ },
621
+ wantErr : false ,
622
+ echoResponse : & echo.Responses {
623
+ Parse : echo .ParseComplete ,
624
+ ProvisionApply : echo .ProvisionApplyWithAgent ("" ),
625
+ },
626
+ wantConfig : wantConfig {
627
+ regexMatch : "--header-command \" /foo/bar/coder arg1 arg2='quoted value'\" ssh" ,
600
628
},
601
629
},
602
630
}
0 commit comments