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

[#17] Allow manually sending "body" in request init #18

Merged
merged 6 commits into from Oct 11, 2022
Merged

Conversation

danawoodman
Copy link
Collaborator

@danawoodman danawoodman commented Oct 11, 2022

Other changes:

  • Add test for changing content-type via request init to verify behavior.
  • Change vitest test environment to jsdom. This removes the need for importing isometric-fetch and brings the test env closer to the DOM which seems a safe baseline test env.

Closes #17

@danawoodman danawoodman marked this pull request as draft October 11, 2022 18:43
@danawoodman danawoodman removed the request for review from kwhitley October 11, 2022 18:43
@danawoodman danawoodman marked this pull request as ready for review October 11, 2022 19:38
@danawoodman danawoodman changed the title Change vitest test environment to jsdom Allow manually sending "body" in request init Oct 11, 2022
@danawoodman danawoodman changed the title Allow manually sending "body" in request init [#17] Allow manually sending "body" in request init Oct 11, 2022
@kwhitley
Copy link
Owner

Merging this is a work-off point for a PR to modify behavior...

@kwhitley
Copy link
Owner

Gonna add a few bytes, but hopefully only temporarily

@danawoodman danawoodman deleted the vitest-jsdom-env branch October 11, 2022 21:00
@danawoodman
Copy link
Collaborator Author

@kwhitley just curious, whatcha gonna change?

@kwhitley
Copy link
Owner

  • not embedding application/json by default (to allow blobs to override it)
  • not stringifying if instanceof FormData || Blob

Couple tests will have to change, but, although a breaking change (yay for pre-release), no one's code should really break

@kwhitley
Copy link
Owner

image
Something like this...

@kwhitley
Copy link
Owner

would have used passthrough on the body: ... line too but was getting a TS error I was too impatient to sort through, lol

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FIX: defined headers should be honored *over* injected headers
2 participants