Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 66bd65e

Browse files
committed
move middlewar
1 parent a6afc33 commit 66bd65e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

enterprise/coderd/httpmw/provisionerdaemon_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,10 +177,11 @@ func TestExtractProvisionerDaemonAuthenticated(t *testing.T) {
177177
httpmw.ExtractProvisionerDaemonAuthenticated(httpmw.ExtractProvisionerAuthConfig{
178178
DB: db,
179179
Optional: false,
180-
})(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
180+
})(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
181181
w.WriteHeader(http.StatusOK)
182182
})).ServeHTTP(res, r)
183183

184+
//nolint:bodyclose
184185
require.Equal(t, http.StatusOK, res.Result().StatusCode)
185186
})
186187

@@ -212,10 +213,11 @@ func TestExtractProvisionerDaemonAuthenticated(t *testing.T) {
212213
httpmw.ExtractProvisionerDaemonAuthenticated(httpmw.ExtractProvisionerAuthConfig{
213214
DB: db,
214215
Optional: false,
215-
})(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
216+
})(http.HandlerFunc(func(w http.ResponseWriter, _ *http.Request) {
216217
w.WriteHeader(http.StatusOK)
217218
})).ServeHTTP(res, r)
218219

220+
//nolint:bodyclose
219221
require.Equal(t, http.StatusUnauthorized, res.Result().StatusCode)
220222
require.Contains(t, res.Body.String(), "provisioner daemon key invalid")
221223
})

0 commit comments

Comments
 (0)