From c8c5f8ced6d79cc532710023355deae8460a0357 Mon Sep 17 00:00:00 2001 From: Kyle Carberry Date: Mon, 17 Apr 2023 23:28:56 +0000 Subject: [PATCH] fix: add global headers to `vscodessh` command --- cli/vscodessh.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/cli/vscodessh.go b/cli/vscodessh.go index 85ee1e18e4370..363f0215a7696 100644 --- a/cli/vscodessh.go +++ b/cli/vscodessh.go @@ -27,7 +27,7 @@ import ( // This command needs to remain stable for compatibility with // various VS Code versions, so it's kept separate from our // standard SSH command. -func (*RootCmd) vscodeSSH() *clibase.Cmd { +func (r *RootCmd) vscodeSSH() *clibase.Cmd { var ( sessionTokenFile string urlFile string @@ -82,6 +82,12 @@ func (*RootCmd) vscodeSSH() *clibase.Cmd { client := codersdk.New(serverURL) client.SetSessionToken(string(sessionToken)) + // This adds custom headers to the request! + err = r.setClient(client, serverURL) + if err != nil { + return xerrors.Errorf("set client: %w", err) + } + parts := strings.Split(inv.Args[0], "--") if len(parts) < 3 { return xerrors.Errorf("invalid argument format. must be: coder-vscode----")