[Plugins] [CopyAsCURL] [Auth] [JWT] Include custom bearer prefix to copy CURL (#253)

Co-authored-by: Gregory Schier <gschier1990@gmail.com>
This commit is contained in:
moshyfawn
2025-09-16 14:20:23 -04:00
committed by GitHub
parent 28c6af8f94
commit 907e09a417
2 changed files with 39 additions and 10 deletions
+3 -1
View File
@@ -93,7 +93,9 @@ export async function convertToCurl(request: Partial<HttpRequest>) {
// Add bearer authentication
if (request.authenticationType === 'bearer') {
xs.push('--header', quote(`Authorization: Bearer ${request.authentication?.token ?? ''}`));
const value =
`${request.authentication?.prefix ?? 'Bearer'} ${request.authentication?.token ?? ''}`.trim();
xs.push('--header', quote(`Authorization: ${value}`));
xs.push(NEWLINE);
}