Skip to content

fix: treat empty request body as POST#81

Draft
leno23 wants to merge 1 commit into
mhart:masterfrom
leno23:hermes-auto/aws4fetch-54-empty-post-body-20260517155107
Draft

fix: treat empty request body as POST#81
leno23 wants to merge 1 commit into
mhart:masterfrom
leno23:hermes-auto/aws4fetch-54-empty-post-body-20260517155107

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 17, 2026

Summary

  • Treat an explicitly provided empty request body ("", empty buffers, etc.) as a present body when inferring the default HTTP method.
  • Keep null/undefined as no-body values so requests without a body still default to GET.
  • Add regression coverage for empty-string bodies defaulting to POST.

Related Issues / Closes

Closes #54

Testing

  • Added the regression first and verified it failed before the source change with TypeError: Request with GET/HEAD method cannot have body.
  • node run-param-tests.mjs — passed (temporary focused Rollup runner for test/paramTests.js, removed before commit)
  • npm run lint -- --quiet — passed
  • git diff --check — passed

AI assistance disclosure

This draft PR was prepared by Hermes Agent as an automated maintainer-assist change. A human maintainer should review before marking ready or merging.

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.

POST with empty body

1 participant