Skip to content

Fix App user-agent merging#573

Open
heyitsaamir wants to merge 1 commit into
mainfrom
fix-app-user-agent-merge
Open

Fix App user-agent merging#573
heyitsaamir wants to merge 1 commit into
mainfrom
fix-app-user-agent-merge

Conversation

@heyitsaamir
Copy link
Copy Markdown
Collaborator

@heyitsaamir heyitsaamir commented May 13, 2026

Summary

  • Fix App client option handling so custom User-Agent values get merged instead of stomped.
  • Add a regression test for lowercase user-agent

Test plan

  • UTs

Copilot AI review requested due to automatic review settings May 13, 2026 23:46
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes how App constructs its internal HTTP client when the caller supplies client options, ensuring custom User-Agent values are merged (case-insensitively) instead of being overwritten or duplicated. This aligns App’s behavior with the existing Client.clone() header-merging semantics in @microsoft/teams.common.

Changes:

  • Update App HTTP client initialization to use Client.clone() for User-Agent merging when options.client is a ClientOptions object.
  • Add a regression test verifying case-insensitive merging when the caller provides user-agent in lowercase.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
packages/apps/src/app.ts Uses new HttpClient(options.client).clone({ headers: { 'User-Agent': ... }}) to merge User-Agent instead of overwriting/duplicating it.
packages/apps/src/app.spec.ts Adds a test asserting App’s UA is merged with a user-provided lowercase user-agent header.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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