Skip to content

setCookie is not set for status error #1269

@Pinegin

Description

@Pinegin

Environment

"h3": "^2.0.1-rc.6"

Reproduction

defineHandler({
  middleware: [
    onResponse((response, event) => {
      setCookie(event, 'test', 'test')
    }),
  ],
  handler: (event) => {
    if (true) {
      return new HTTPResponse('test_2', { status: 300 })
    }

    return new HTTPResponse('test_1', { status: 299 })
  },
})

Describe the bug

if the response status is less than 300, cookies are set, if more than that, no cookies are set.

Additional context

No response

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions