mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-12-06 14:56:23 +01:00
[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:
1 parent
28c6af8f94
commit
907e09a417
2 files changed
+39
-10
No files matched your search
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user