Skip to content

Make urlBase protected so makeFetchRequest overrides can use it - #438

Open
Ahmed8881 wants to merge 1 commit into
apple:mainfrom
Ahmed8881:fix/urlbase-protected
Open

Make urlBase protected so makeFetchRequest overrides can use it#438
Ahmed8881 wants to merge 1 commit into
apple:mainfrom
Ahmed8881:fix/urlbase-protected

Conversation

@Ahmed8881

Copy link
Copy Markdown

Summary

makeFetchRequest (index.ts) is protected specifically so subclasses can override the HTTP transport, but urlBase was private, so an override had no way to read the configured base URL and had to hardcode/duplicate the production/sandbox/local-testing hosts itself. This changes urlBase from private to protected, matching the existing extension point.

This is a one-line visibility change with no behavior change to the public API.

Fixes the urlBase visibility part of #424. (The request timeout part of that issue was already addressed in #425.)

This also directly unblocks the workaround described in #352 (attaching an outbound proxy agent via a makeFetchRequest override), since that override can now resolve the correct host without duplicating the private constants.

Test plan

  • npx tsc -p . builds cleanly
  • npx jest — all 20 suites / 336 tests pass
  • No existing tests reference urlBase's visibility, so no test changes were needed

makeFetchRequest is protected specifically so subclasses can override
the HTTP transport, but urlBase was private, so an override had no way
to read the configured base URL and had to hardcode/duplicate the
production/sandbox/local-testing hosts itself.

Fixes apple#424 (urlBase visibility part; the request timeout part of that
issue was already addressed in apple#425).
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