MCPcopy
hub / github.com/gofiber/fiber / Test_Request_UserAgent_With_Server

Function Test_Request_UserAgent_With_Server

client/request_test.go:1159–1177  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1157}
1158
1159func Test_Request_UserAgent_With_Server(t *testing.T) {
1160 t.Parallel()
1161
1162 handler := func(c fiber.Ctx) error {
1163 return c.Send(c.Request().Header.UserAgent())
1164 }
1165
1166 t.Run("default", func(t *testing.T) {
1167 t.Parallel()
1168 testRequest(t, handler, func(_ *Request) {}, defaultUserAgent, 5)
1169 })
1170
1171 t.Run("custom", func(t *testing.T) {
1172 t.Parallel()
1173 testRequest(t, handler, func(agent *Request) {
1174 agent.SetUserAgent("ua")
1175 }, "ua", 5)
1176 })
1177}
1178
1179func Test_Request_Cookie_With_Server(t *testing.T) {
1180 t.Parallel()

Callers

nothing calls this directly

Calls 5

testRequestFunction · 0.85
SendMethod · 0.65
UserAgentMethod · 0.65
RequestMethod · 0.65
SetUserAgentMethod · 0.45

Tested by

no test coverage detected