Skip to content

Appending set-cookie header in middleware leads to duplicate header #2470

Description

@serhalp

When appending a set-cookie header, the server returns two copies of the header. e.g.

export async function middleware(request, ev) {
  const next = NextResponse.next()
  next.headers.append('set-cookie', 'bar=chocochip')
  return next
}

Leads to:

image

Data

The following is parsed automatically by the Next.js repo e2e test report generator.

test: test/e2e/middleware-responses/test/index.test.ts
reason: Appending set-cookie header in middleware leads to duplicate header

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions