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

fix: copy duplex option from Request object #25

Merged
merged 21 commits into from
Dec 30, 2024
Merged

fix: copy duplex option from Request object #25

merged 21 commits into from
Dec 30, 2024

Conversation

zirkelc
Copy link
Owner

@zirkelc zirkelc commented Dec 13, 2024

When fetching with a Request object, some properties were not copied over to the final signed fetch.
This caused a TypeError because Node.js expect the duplex option to be set when sending a body:

TypeError: RequestInit: duplex option is required when sending a body.

nodejs/node#46221
whatwg/fetch#1457

Fixes #19

Copy link
Contributor

github-actions bot commented Dec 13, 2024

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 100% 146 / 146
🔵 Statements 100% 146 / 146
🔵 Functions 100% 7 / 7
🔵 Branches 97.05% 33 / 34
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/__fixtures__.ts 100% 100% 100% 100%
src/create-signed-fetcher.ts 100% 100% 100% 100%
src/index.ts 100% 100% 100% 100%
src/parse-request.ts 100% 100% 100% 100%
src/sign-request.ts 100% 83.33% 100% 100%
Generated in workflow #121 for commit 0239717 by the Vitest Coverage Report Action

Copy link

pkg-pr-new bot commented Dec 13, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/zirkelc/aws-sigv4-fetch@25

commit: 0239717

@zirkelc zirkelc merged commit c5c8b49 into main Dec 30, 2024
9 checks passed
@zirkelc zirkelc deleted the duplex branch December 30, 2024 07:43
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.

Non-GET requests don't work when passed as a single Request argument
1 participant