Skip to content

fix(web, webhook, scim, audit_logs): copy the headers dict passed to … - #2079

Open
Shriraj1901 wants to merge 1 commit into
slackapi:mainfrom
Shriraj1901:fix-client-headers-copy
Open

Shriraj1901 wants to merge 1 commit into
slackapi:mainfrom
Shriraj1901:fix-client-headers-copy

Conversation

@Shriraj1901

Copy link
Copy Markdown

…the client constructors

The clients stored the headers / default_headers dict they were given and then wrote the generated User-Agent into it. That changed the caller's dict, and two clients created from the same dict shared one headers object, so the second client's user_agent_prefix replaced the first client's.

Copy the dict in WebClient, AsyncWebClient, LegacyWebClient, WebhookClient, AsyncWebhookClient, AuditLogsClient, AsyncAuditLogsClient, SCIMClient and AsyncSCIMClient. Add a test that covers all of them.

Summary

Testing

Category

  • slack_sdk.web.WebClient (sync/async) (Web API client)
  • slack_sdk.webhook.WebhookClient (sync/async) (Incoming Webhook, response_url sender)
  • slack_sdk.socket_mode (Socket Mode client)
  • slack_sdk.signature (Request Signature Verifier)
  • slack_sdk.oauth (OAuth Flow Utilities)
  • slack_sdk.models (UI component builders)
  • slack_sdk.scim (SCIM API client)
  • slack_sdk.audit_logs (Audit Logs API client)
  • slack_sdk.rtm_v2 (RTM client)
  • /docs (Documents)
  • /tutorial (PythOnBoardingBot tutorial)
  • tests/integration_tests (Automated tests for this library)

Requirements

  • I've read and understood the Contributing Guidelines and have done my best effort to follow them.
  • I've read and agree to the Code of Conduct.
  • I have signed the Salesforce CLA (required before your PR can be reviewed or merged).
  • I've run python3 -m venv .venv && source .venv/bin/activate && ./scripts/run_validation.sh after making the changes.

…the client constructors

The clients stored the headers / default_headers dict they were given and
then wrote the generated User-Agent into it. That changed the caller's
dict, and two clients created from the same dict shared one headers object,
so the second client's user_agent_prefix replaced the first client's.

Copy the dict in WebClient, AsyncWebClient, LegacyWebClient, WebhookClient,
AsyncWebhookClient, AuditLogsClient, AsyncAuditLogsClient, SCIMClient and
AsyncSCIMClient. Add a test that covers all of them.
@Shriraj1901
Shriraj1901 requested a review from a team as a code owner November 21, 2026 14:44
@salesforce-cla

Copy link
Copy Markdown

Thanks for the contribution! Before we can merge this, we need @Shriraj1901 to sign the Salesforce Inc. Contributor License Agreement.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant