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

Method TestHeaderInDev

router/router_test.go:62–71  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

60}
61
62func (s *IntegrationSuite) TestHeaderInDev() {
63 mode.Set(mode.TestDev)
64 req := s.newRequest("GET", "version", "")
65 // Needs an origin to indicate that it is a CORS request
66 req.Header.Add("Origin", "some-origin")
67
68 res, err := client.Do(req)
69 assert.Nil(s.T(), err)
70 assert.NotEmpty(s.T(), res.Header.Get("Access-Control-Allow-Origin"))
71}
72
73func (s *IntegrationSuite) TestHeaderInProd() {
74 mode.Set(mode.Prod)

Callers

nothing calls this directly

Calls 3

newRequestMethod · 0.95
SetFunction · 0.92
DoMethod · 0.80

Tested by

no test coverage detected