You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: add User-Agent header to all outbound HTTP requests
Add explicit User-Agent header to all HTTP requests made by the SDK.
The header follows the format: flagsmith-rust-sdk/<version>
Implementation details:
- Created get_user_agent() function that reads version from CARGO_PKG_VERSION
at compile time using option_env! macro
- Falls back to "flagsmith-rust-sdk/unknown" if version unavailable
- User-Agent header is added to default headers in Flagsmith client constructor
- Header is automatically included in both API requests and analytics calls
Testing:
- Added test_get_user_agent_format() to verify the function returns correct format
and actual version (not "unknown") during cargo test
- Added test_user_agent_header_is_set() to verify the header is sent in HTTP
requests using httpmock
0 commit comments