[AI-FSSDK] (DO NOT REVIEW) [FSSDK-12273] Add support for custom headers in polling datafile managers #489
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for custom headers in polling datafile managers (
PollingConfigManagerandAuthDatafilePollingConfigManager). Users can now pass custom headers when initializing the SDK client instance, which will be included in HTTP requests to fetch the datafile.Reference implementation: optimizely/javascript-sdk#1107
Changes
custom_headersparameter toPollingConfigManager.__init__()custom_headersparameter toOptimizely.__init__()and passed to config managersfetch_datafile()methods to merge custom headers with internal headersUsage Example
```python
from optimizely import optimizely
Initialize SDK with custom headers
client = optimizely.Optimizely(
sdk_key='your_sdk_key',
custom_headers={
'X-Custom-Header': 'custom_value',
'Authorization': 'Bearer custom_token' # Overrides internal auth if needed
}
)
```
Testing
Added test cases covering:
Related
🤖 Generated with Claude Code