ref: move httpapi.Reponse into codersdk (#2954)

This commit is contained in:
Jon Ayers
2022-07-12 19:15:02 -05:00
committed by GitHub
parent dde51f1caa
commit 7e9819f2a8
53 changed files with 524 additions and 486 deletions

View File

@ -20,7 +20,6 @@ import (
"cdr.dev/slog"
"github.com/coder/coder/agent"
"github.com/coder/coder/coderd/httpmw"
"github.com/coder/coder/coderd/turnconn"
"github.com/coder/coder/peer"
"github.com/coder/coder/peer/peerwg"
@ -189,7 +188,7 @@ func (c *Client) ListenWorkspaceAgent(ctx context.Context, logger slog.Logger) (
return agent.Metadata{}, nil, xerrors.Errorf("create cookie jar: %w", err)
}
jar.SetCookies(serverURL, []*http.Cookie{{
Name: httpmw.SessionTokenKey,
Name: SessionTokenKey,
Value: c.SessionToken,
}})
httpClient := &http.Client{
@ -285,7 +284,7 @@ func (c *Client) WireguardPeerListener(ctx context.Context, logger slog.Logger)
return nil, nil, xerrors.Errorf("create cookie jar: %w", err)
}
jar.SetCookies(serverURL, []*http.Cookie{{
Name: httpmw.SessionTokenKey,
Name: SessionTokenKey,
Value: c.SessionToken,
}})
httpClient := &http.Client{
@ -355,7 +354,7 @@ func (c *Client) DialWorkspaceAgent(ctx context.Context, agentID uuid.UUID, opti
return nil, xerrors.Errorf("create cookie jar: %w", err)
}
jar.SetCookies(serverURL, []*http.Cookie{{
Name: httpmw.SessionTokenKey,
Name: SessionTokenKey,
Value: c.SessionToken,
}})
httpClient := &http.Client{
@ -443,7 +442,7 @@ func (c *Client) WorkspaceAgentReconnectingPTY(ctx context.Context, agentID, rec
return nil, xerrors.Errorf("create cookie jar: %w", err)
}
jar.SetCookies(serverURL, []*http.Cookie{{
Name: httpmw.SessionTokenKey,
Name: SessionTokenKey,
Value: c.SessionToken,
}})
httpClient := &http.Client{