mirror of https://github.com/coder/coder.git
fix: add global headers to `vscodessh` command (#7181)
This commit is contained in:
parent
56bf9cfdbe
commit
693e5d94bc
|
@ -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--<owner>-<name>-<agent?>")
|
||||
|
|
Loading…
Reference in New Issue