Commit 4a3a6d4
committed
feat: add --header / -H flag for custom HTTP headers in fetch command
Allows passing arbitrary HTTP headers to fetch requests, enabling:
- Authorization: Bearer tokens for authenticated APIs like SOM Cache
- Custom headers for sites that require specific request headers
- Multiple headers via repeated --header flags
Examples:
plasmate fetch https://cache.plasmate.app/v1/som?url=... -H 'Authorization: Bearer sk-...'
plasmate fetch https://example.com -H 'X-Custom: value' -H 'Accept-Language: en'
The flag is available as --header or -H (matching curl convention).
Internally adds build_client_h1_fallback_with_headers() to the network layer.1 parent 3bc5f8d commit 4a3a6d4
2 files changed
Lines changed: 56 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
140 | 149 | | |
141 | 150 | | |
142 | 151 | | |
| |||
391 | 400 | | |
392 | 401 | | |
393 | 402 | | |
| 403 | + | |
394 | 404 | | |
395 | 405 | | |
396 | 406 | | |
| |||
405 | 415 | | |
406 | 416 | | |
407 | 417 | | |
| 418 | + | |
| 419 | + | |
408 | 420 | | |
409 | 421 | | |
410 | 422 | | |
| |||
415 | 427 | | |
416 | 428 | | |
417 | 429 | | |
| 430 | + | |
418 | 431 | | |
419 | 432 | | |
420 | 433 | | |
| |||
993 | 1006 | | |
994 | 1007 | | |
995 | 1008 | | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
996 | 1026 | | |
997 | 1027 | | |
998 | 1028 | | |
| |||
1003 | 1033 | | |
1004 | 1034 | | |
1005 | 1035 | | |
| 1036 | + | |
1006 | 1037 | | |
1007 | 1038 | | |
1008 | 1039 | | |
| |||
1040 | 1071 | | |
1041 | 1072 | | |
1042 | 1073 | | |
1043 | | - | |
| 1074 | + | |
| 1075 | + | |
1044 | 1076 | | |
1045 | 1077 | | |
1046 | 1078 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
79 | 101 | | |
80 | 102 | | |
| 103 | + | |
81 | 104 | | |
82 | 105 | | |
83 | 106 | | |
| |||
0 commit comments