Skip to content

[🐞] Support fetch Response in send() #289

@zhuhaow

Description

@zhuhaow

Which component is affected?

Qwik City (routing)

Describe the bug

We cannot send a redirect response with send.

export const onGet: RequestHandler = async ({ send }) => {
  const response = await fetch(from_somewhere); // If this is a redirect response.
  await send(response);
};

This would return a 404 response.

Reproduction

https://stackblitz.com/edit/qwik-starter-nnzpec?file=src/routes/index.tsx

Steps to reproduce

No response

System Info

System:
    OS: macOS 13.2.1
    CPU: (10) arm64 Apple M1 Pro
    Memory: 82.17 MB / 32.00 GB
    Shell: 5.8.1 - /bin/zsh
  Binaries:
    Node: 16.14.2 - ~/.nvm/versions/node/v16.14.2/bin/node
    npm: 8.5.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
  Browsers:
    Chrome: 110.0.5481.177
    Safari: 16.3
  npmPackages:
    @builder.io/partytown: ^0.7.5 => 0.7.5
    @builder.io/qwik: 0.20.1 => 0.20.1
    @builder.io/qwik-city: 0.5.2 => 0.5.2
    undici: ^5.20.0 => 5.20.0
    vite: 4.1.4 => 4.1.4

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    [STAGE-1.5] looking for championAdd this label after a proposal was discussed but is missing someone to implement it

    Type

    No type

    Projects

    Status

    In Progress (STAGE 2)

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions