@@ -253,6 +253,42 @@ var _ = Describe("Headers Suite", func() {
253253 },
254254 expectedErr: "",
255255 }),
256+
257+ Entry("with flattenHeaders (set-cookie and any other)", headersTableInput{
258+ headers: []options.Header{
259+ {
260+ Name: "Set-Cookie",
261+ Values: []options.HeaderValue{
262+ {
263+ SecretSource: &options.SecretSource{
264+ Value: []byte("_oauth2_proxy=ey123123123"),
265+ },
266+ },
267+ },
268+ },
269+ {
270+ Name: "X-Auth-User",
271+ Values: []options.HeaderValue{
272+ {
273+ SecretSource: &options.SecretSource{
274+ Value: []byte("oauth_user"),
275+ },
276+ },
277+ },
278+ },
279+ },
280+ initialHeaders: http.Header{
281+ "Set-Cookie": []string{"cookie1=value1", "cookie2=value2"},
282+ "X-Auth-User": []string{"oauth_user_1"},
283+ },
284+
285+ expectedHeaders: http.Header{
286+ "Set-Cookie": []string{"cookie1=value1", "cookie2=value2", "_oauth2_proxy=ey123123123"},
287+ "X-Auth-User": []string{"oauth_user_1,oauth_user"},
288+ },
289+ expectedErr: "",
290+ }),
291+
256292 Entry("with a claim valued header", headersTableInput{
257293 headers: []options.Header{
258294 {