Skip to content

Conversation

Magi1053
Copy link

🚥 Resolves #1046

🧰 Changes

This PR adds support for passing custom init options to the fetch request in the API core.

  • The ConfigOptions interface now includes an optional init property, allowing users to specify additional RequestInit options.
  • The APICore class now merges config.init into the fetch request's init object, ensuring user-supplied options are respected (except for signal, which is managed internally).

🧬 QA & Testing

  1. Set up an instance of APICore and pass custom init options (e.g., custom headers or credentials) via setConfig({ init: { ... } }).
  2. Make a request using fetch or fetchOperation.
  3. Verify that the custom init options are present in the outgoing request (except for signal).
  4. Ensure that the request still respects the internal timeout and abort logic.
  5. Run the existing test suite to confirm no regressions.

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.

1 participant