Files
coder/coderd/httpapi/cookie_test.go
Kyle Carberry 22e781eced chore: add /v2 to import module path (#9072)
* chore: add /v2 to import module path

go mod requires semantic versioning with versions greater than 1.x

This was a mechanical update by running:
```
go install github.com/marwan-at-work/mod/cmd/mod@latest
mod upgrade
```

Migrate generated files to import /v2

* Fix gen
2023-08-18 18:55:43 +00:00

36 lines
673 B
Go

package httpapi_test
import (
"testing"
"github.com/stretchr/testify/require"
"github.com/coder/coder/v2/coderd/httpapi"
)
func TestStripCoderCookies(t *testing.T) {
t.Parallel()
for _, tc := range []struct {
Input string
Output string
}{{
"testing=hello; wow=test",
"testing=hello; wow=test",
}, {
"coder_session_token=moo; wow=test",
"wow=test",
}, {
"another_token=wow; coder_session_token=ok",
"another_token=wow",
}, {
"coder_session_token=ok; oauth_state=wow; oauth_redirect=/",
"",
}} {
tc := tc
t.Run(tc.Input, func(t *testing.T) {
t.Parallel()
require.Equal(t, tc.Output, httpapi.StripCoderCookies(tc.Input))
})
}
}