Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Headers lost in fetch request when using BUN #1736

Open
ryou90 opened this issue Jun 28, 2024 · 0 comments
Open

Headers lost in fetch request when using BUN #1736

ryou90 opened this issue Jun 28, 2024 · 0 comments
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library

Comments

@ryou90
Copy link

ryou90 commented Jun 28, 2024

Description

To make Openapi-Fetch more compatible with Bun, the fetch call should be modified.
The problem is that Bun removes all header information within the request object.
To avoid this problem, the headers should be passed as extra parameters and not within the request object.

See also here: oven-sh/bun#9846

Current behavior :

let response = await fetch(request);

Suggestion:

let response = await fetch(request, {headers : headers});

Reproduction
Create simple Get request with header informations.

Expected result

Headers send with request

@ryou90 ryou90 added bug Something isn't working openapi-fetch Relevant to the openapi-fetch library labels Jun 28, 2024
@ryou90 ryou90 changed the title Header lost when using BUN Headers lost in fetch request when using BUN Jun 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working openapi-fetch Relevant to the openapi-fetch library
Projects
None yet
Development

No branches or pull requests

1 participant