AppClient returns a *codersdk.Client that will route all requests to the app server. API requests will fail with this client. Any redirect responses are not followed by default. The client is authenticated as the first user by default.
(t *testing.T)
| 137 | // |
| 138 | // The client is authenticated as the first user by default. |
| 139 | func (d *Details) AppClient(t *testing.T) *codersdk.Client { |
| 140 | client := codersdk.New(d.PathAppBaseURL, codersdk.WithSessionToken(d.SDKClient.SessionToken())) |
| 141 | forceURLTransport(t, client) |
| 142 | client.HTTPClient.CheckRedirect = func(_ *http.Request, _ []*http.Request) error { |
| 143 | return http.ErrUseLastResponse |
| 144 | } |
| 145 | |
| 146 | return client |
| 147 | } |
| 148 | |
| 149 | // PathAppURL returns the URL for the given path app. |
| 150 | func (d *Details) PathAppURL(app App) *url.URL { |
no test coverage detected