Repository navigation
fix: apply custom_headers to API client requests #131
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,7 +32,7 @@ def build_headers(faraday, config) | |
| faraday.headers['Content-Type'] = 'application/json' | ||
| faraday.headers['X-Environment-Key'] = config.environment_key | ||
| faraday.headers['User-Agent'] = Flagsmith::SDK::Utils.user_agent | ||
| faraday.headers.merge(config.custom_headers) | ||
| faraday.headers.merge!(config.custom_headers) | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Keep custom credentials out of request logs. With the default logger, a request now logs the configured Apply one precedence rule to
Choose one rule for conflicting |
||
| end | ||
|
|
||
| def configure_logger(faraday, config) | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P2: A configured
X-Environment-Keyincustom_headersreplacesconfig.environment_key, sending API requests under the wrong environment. Reapply the SDK-owned environment key after merging custom headers.Prompt for AI agents