Skip to content

Commit 693e5d9

Browse files
authored
fix: add global headers to vscodessh command (#7181)
1 parent 56bf9cf commit 693e5d9

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

cli/vscodessh.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import (
2727
// This command needs to remain stable for compatibility with
2828
// various VS Code versions, so it's kept separate from our
2929
// standard SSH command.
30-
func (*RootCmd) vscodeSSH() *clibase.Cmd {
30+
func (r *RootCmd) vscodeSSH() *clibase.Cmd {
3131
var (
3232
sessionTokenFile string
3333
urlFile string
@@ -82,6 +82,12 @@ func (*RootCmd) vscodeSSH() *clibase.Cmd {
8282
client := codersdk.New(serverURL)
8383
client.SetSessionToken(string(sessionToken))
8484

85+
// This adds custom headers to the request!
86+
err = r.setClient(client, serverURL)
87+
if err != nil {
88+
return xerrors.Errorf("set client: %w", err)
89+
}
90+
8591
parts := strings.Split(inv.Args[0], "--")
8692
if len(parts) < 3 {
8793
return xerrors.Errorf("invalid argument format. must be: coder-vscode--<owner>-<name>-<agent?>")

0 commit comments

Comments
 (0)