Commit 4086efe
authored
feat: add support for custom HTTP headers in client requests (#546)
* feat: add support for custom HTTP headers in client requests
This update introduces the ability to include custom HTTP headers in requests sent from the client. This enhancement facilitates more flexible and secure communication with servers by allowing clients to pass additional information in the header of each request, such as authentication tokens or custom metadata. This feature is crucial for integrating with APIs that require specific headers for access control, content negotiation, or tracking purposes.
Signed-off-by: Matthis Holleville <[email protected]>
* feat(client/transport): enhance HTTP request flexibility
Enhanced the flexibility of HTTP requests in the streamable HTTP client by allowing additional headers to be specified. This change aims to support more diverse server requirements and improve the adaptability of our client transport layer.
Signed-off-by: Matthis Holleville <[email protected]>
* fix: Improve OAuth error handling and test readability in HTTP transport
- Enhanced OAuth error detection by using `errors.Is` for more reliable error handling.
- Corrected a typo in a comment and improved code readability in tests by using a variable for headers.
Signed-off-by: Matthis Holleville <[email protected]>
* fix: improve variable naming for clarity in streamable_http_test
Signed-off-by: Matthis Holleville <[email protected]>
* feat: Ensure system headers are preserved in streamable HTTP tests
To maintain consistency and ensure the integrity of HTTP headers during tests, system headers like Content-Type are now verified to be preserved. This change enhances the reliability of our testing framework by ensuring essential headers are not inadvertently removed or altered during the testing process.
Signed-off-by: Matthis Holleville <[email protected]>
---------
Signed-off-by: Matthis Holleville <[email protected]>1 parent f60537b commit 4086efe
File tree
4 files changed
+85
-15
lines changed- client
- transport
4 files changed
+85
-15
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| |||
140 | 141 | | |
141 | 142 | | |
142 | 143 | | |
| 144 | + | |
143 | 145 | | |
144 | 146 | | |
145 | 147 | | |
| |||
152 | 154 | | |
153 | 155 | | |
154 | 156 | | |
| 157 | + | |
155 | 158 | | |
156 | 159 | | |
157 | 160 | | |
| |||
193 | 196 | | |
194 | 197 | | |
195 | 198 | | |
196 | | - | |
| 199 | + | |
197 | 200 | | |
198 | 201 | | |
199 | 202 | | |
| |||
238 | 241 | | |
239 | 242 | | |
240 | 243 | | |
241 | | - | |
| 244 | + | |
242 | 245 | | |
243 | 246 | | |
244 | 247 | | |
| |||
319 | 322 | | |
320 | 323 | | |
321 | 324 | | |
322 | | - | |
| 325 | + | |
323 | 326 | | |
324 | 327 | | |
325 | 328 | | |
| |||
331 | 334 | | |
332 | 335 | | |
333 | 336 | | |
334 | | - | |
| 337 | + | |
335 | 338 | | |
336 | 339 | | |
337 | 340 | | |
338 | 341 | | |
339 | 342 | | |
340 | 343 | | |
341 | 344 | | |
342 | | - | |
| 345 | + | |
343 | 346 | | |
344 | 347 | | |
345 | 348 | | |
| |||
383 | 386 | | |
384 | 387 | | |
385 | 388 | | |
386 | | - | |
| 389 | + | |
387 | 390 | | |
388 | 391 | | |
389 | 392 | | |
| |||
431 | 434 | | |
432 | 435 | | |
433 | 436 | | |
434 | | - | |
| 437 | + | |
435 | 438 | | |
436 | 439 | | |
437 | 440 | | |
| |||
443 | 446 | | |
444 | 447 | | |
445 | 448 | | |
446 | | - | |
| 449 | + | |
447 | 450 | | |
448 | 451 | | |
449 | 452 | | |
450 | 453 | | |
451 | 454 | | |
452 | 455 | | |
453 | 456 | | |
454 | | - | |
| 457 | + | |
455 | 458 | | |
456 | 459 | | |
457 | 460 | | |
| |||
591 | 594 | | |
592 | 595 | | |
593 | 596 | | |
594 | | - | |
| 597 | + | |
595 | 598 | | |
596 | 599 | | |
597 | 600 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
59 | 60 | | |
60 | 61 | | |
61 | 62 | | |
| 63 | + | |
62 | 64 | | |
63 | 65 | | |
64 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
265 | 265 | | |
266 | 266 | | |
267 | 267 | | |
268 | | - | |
| 268 | + | |
269 | 269 | | |
270 | 270 | | |
271 | 271 | | |
| |||
346 | 346 | | |
347 | 347 | | |
348 | 348 | | |
| 349 | + | |
349 | 350 | | |
350 | 351 | | |
351 | 352 | | |
352 | 353 | | |
353 | 354 | | |
354 | 355 | | |
355 | 356 | | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
356 | 362 | | |
357 | 363 | | |
358 | 364 | | |
| |||
375 | 381 | | |
376 | 382 | | |
377 | 383 | | |
378 | | - | |
| 384 | + | |
379 | 385 | | |
380 | 386 | | |
381 | 387 | | |
| |||
546 | 552 | | |
547 | 553 | | |
548 | 554 | | |
549 | | - | |
| 555 | + | |
550 | 556 | | |
551 | 557 | | |
552 | 558 | | |
| |||
642 | 648 | | |
643 | 649 | | |
644 | 650 | | |
645 | | - | |
| 651 | + | |
646 | 652 | | |
647 | 653 | | |
648 | 654 | | |
| |||
757 | 763 | | |
758 | 764 | | |
759 | 765 | | |
760 | | - | |
| 766 | + | |
761 | 767 | | |
762 | 768 | | |
763 | 769 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
70 | 70 | | |
71 | 71 | | |
72 | 72 | | |
| 73 | + | |
73 | 74 | | |
74 | 75 | | |
75 | 76 | | |
| |||
122 | 123 | | |
123 | 124 | | |
124 | 125 | | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
125 | 144 | | |
126 | 145 | | |
127 | 146 | | |
| |||
215 | 234 | | |
216 | 235 | | |
217 | 236 | | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
218 | 277 | | |
219 | 278 | | |
220 | 279 | | |
| |||
0 commit comments