(t *testing.T)
| 9 | ) |
| 10 | |
| 11 | func 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 | } |
nothing calls this directly
no test coverage detected