Skip to content

feat: Add postWithTimeout to FetchUtils#1373

Merged
nicholaspai merged 5 commits intomasterfrom
fetchPostWithTimeout
Apr 2, 2026
Merged

feat: Add postWithTimeout to FetchUtils#1373
nicholaspai merged 5 commits intomasterfrom
fetchPostWithTimeout

Conversation

@nicholaspai
Copy link
Copy Markdown
Member

Summary

  • Extract shared fetch logic (URL building, timeout, error handling, JSON parsing) into a private baseFetch helper
  • fetchWithTimeout now delegates to baseFetch with method: "GET" — no signature changes, fully backwards compatible
  • Add new postWithTimeout export that sends POST requests with a JSON body, defaulting Content-Type to application/json (overridable via headers)
  • Bump version to 4.3.138

Test plan

  • Verify existing fetchWithTimeout callers continue to work unchanged
  • Test postWithTimeout with a JSON body
  • Test postWithTimeout with custom Content-Type header override
  • Test postWithTimeout with query params alongside body
  • Verify timeout and error handling work for both GET and POST

🤖 Generated with Claude Code

Extract shared fetch logic into a private baseFetch helper that both
fetchWithTimeout (GET) and the new postWithTimeout (POST) delegate to.
postWithTimeout defaults Content-Type to application/json, overridable
via headers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nicholaspai nicholaspai requested a review from pxrl April 2, 2026 08:14
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 55ff8050ab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

nicholaspai and others added 3 commits April 2, 2026 10:17
Check for an existing content-type header (case-insensitive) before
injecting the default, preventing duplicate header values when callers
use lowercase "content-type".

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This makes header deduplication reliable regardless of caller casing,
and removes the now-redundant case-insensitive check in postWithTimeout.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@nicholaspai
Copy link
Copy Markdown
Member Author

@codex

@chatgpt-codex-connector
Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep them coming!

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@nicholaspai nicholaspai merged commit 7488859 into master Apr 2, 2026
4 checks passed
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.

2 participants