Commit 7c5154b
feat(rust): Add Config::header() for custom HTTP and WebSocket headers (#520)
## Summary
- Added `custom_headers: HashMap<String, String>` field to `Config`
struct
- Added `Config::header(key, value) -> Self` builder method to set
custom headers
- Custom headers are injected into every HTTP request (via
`create_http_client()`) and WebSocket upgrade request (via
`create_ws_request()`)
- Updated `CHANGELOG.md`
## Use Case
Enables callers to pass arbitrary headers (e.g. `x-cli-cmd`,
`x-channel-key`) for server-side telemetry and analytics without
modifying the SDK internals.
```rust
let config = Config::from_oauth(oauth)
.header("x-cli-cmd", "cash-flow")
.header("x-channel-key", "kol-123");
```
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>1 parent 485cf02 commit 7c5154b
2 files changed
Lines changed: 28 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| 11 | + | |
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| |||
127 | 127 | | |
128 | 128 | | |
129 | 129 | | |
| 130 | + | |
| 131 | + | |
130 | 132 | | |
131 | 133 | | |
132 | 134 | | |
| |||
218 | 220 | | |
219 | 221 | | |
220 | 222 | | |
| 223 | + | |
221 | 224 | | |
222 | 225 | | |
223 | 226 | | |
| |||
266 | 269 | | |
267 | 270 | | |
268 | 271 | | |
| 272 | + | |
269 | 273 | | |
270 | 274 | | |
271 | 275 | | |
| |||
320 | 324 | | |
321 | 325 | | |
322 | 326 | | |
| 327 | + | |
323 | 328 | | |
324 | 329 | | |
325 | 330 | | |
| |||
419 | 424 | | |
420 | 425 | | |
421 | 426 | | |
422 | | - | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
423 | 433 | | |
424 | 434 | | |
425 | 435 | | |
| |||
428 | 438 | | |
429 | 439 | | |
430 | 440 | | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
431 | 449 | | |
432 | 450 | | |
433 | 451 | | |
| |||
471 | 489 | | |
472 | 490 | | |
473 | 491 | | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
| 495 | + | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
474 | 499 | | |
475 | 500 | | |
476 | 501 | | |
| |||
0 commit comments