Skip to content

Conversation

@neerajcharokar
Copy link
Contributor

@neerajcharokar neerajcharokar commented Oct 23, 2025

Description

This PR fixes an issue in the @fluidframework/routerlicious-driver package, specifically in restWrapper.ts, where the function axiosBuildRequestInitConfig was directly accessing requestConfig.headers without checking if it was undefined.

When headers is undefined, the code fails during request initialization, causing runtime errors.

Root Cause

The existing implementation assumed that requestConfig.headers would always be defined:

headers: requestConfig.headers as Record<string, string>,

However, in some cases, the Axios request configuration does not include headers, leading to failures when attempting to spread or cast an undefined value.

If this Pull Request should close/resolve any issues when merged, use the special syntax for that here.

Breaking Changes

If this introduces a breaking change, please describe the impact and migration path for existing applications below.
See Breaking-vs-Non-breaking-Changes for details.
If there are no breaking changes, delete this section.

Reviewer Guidance

The review process is outlined on this wiki page.

List any specific things you want to get reviewer opinions on, and anything a reviewer would need to know to review this PR effectively.
Things you might want to include:

  • Questions about how to properly make automated tests for your changes.
  • Questions about design choices you made.
  • Descriptions of how to manually test the changes (and how much of that you have done).
  • etc.

If you have any questions in this section, consider making the PR a draft until all questions have been resolved.

@github-actions github-actions bot added area: driver Driver related issues base: main PRs targeted against main branch labels Oct 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: driver Driver related issues base: main PRs targeted against main branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants