MCPcopy Index your code
hub / github.com/coder/coder / TestStripCoderCookies

Function TestStripCoderCookies

coderd/httpapi/cookie_test.go:11–43  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestStripCoderCookies(t *testing.T) {
12 t.Parallel()
13 for _, tc := range []struct {
14 Input string
15 Output string
16 }{{
17 "testing=hello; wow=test",
18 "testing=hello; wow=test",
19 }, {
20 "coder_session_token=moo; wow=test",
21 "wow=test",
22 }, {
23 "another_token=wow; coder_session_token=ok",
24 "another_token=wow",
25 }, {
26 "coder_session_token=ok; oauth_state=wow; oauth_redirect=/",
27 "",
28 }, {
29 "coder_path_app_session_token=ok; wow=test",
30 "wow=test",
31 }, {
32 "coder_subdomain_app_session_token=ok; coder_subdomain_app_session_token_1234567890=ok; wow=test",
33 "wow=test",
34 }, {
35 "coder_signed_app_token=ok; wow=test",
36 "wow=test",
37 }} {
38 t.Run(tc.Input, func(t *testing.T) {
39 t.Parallel()
40 require.Equal(t, tc.Output, httpapi.StripCoderCookies(tc.Input))
41 })
42 }
43}

Callers

nothing calls this directly

Calls 3

StripCoderCookiesFunction · 0.92
RunMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected