MCPcopy Create free account
hub / github.com/gotify/server / assertHeaderRequest

Method assertHeaderRequest

auth/authentication_test.go:213–221  ·  view source on GitHub ↗
(key, value string, f fMiddleware, code int)

Source from the content-addressed store, hash-verified

211}
212
213func (s *AuthenticationSuite) assertHeaderRequest(key, value string, f fMiddleware, code int) (ctx *gin.Context) {
214 recorder := httptest.NewRecorder()
215 ctx, _ = gin.CreateTestContext(recorder)
216 ctx.Request = httptest.NewRequest("GET", "/", nil)
217 ctx.Request.Header.Set(key, value)
218 f()(ctx)
219 assert.Equal(s.T(), code, recorder.Code)
220 return ctx
221}
222
223type fMiddleware func() gin.HandlerFunc

Callers 4

TestHeaderApiKeyTokenMethod · 0.95
TestBasicAuthMethod · 0.95
TestOptionalAuthMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected