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 · 1 comment
Open

Headers lost in fetch request when using BUN #1736

ryou90 opened this issue Jun 28, 2024 · 1 comment
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
@marcomuser
Copy link
Contributor

Sounds like a bug in bun not openapi-fetch? I would expect the runtime to conform to the spec instead of having libraries patch all sort of runtime bugs. Especially now since there seems to be a new js runtime every week.

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

2 participants