-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Generated code is incorrect #269
Copy link
Copy link
Closed
Description
Describe the bug
There are a few bugs in the generated code for each request type (JavaScript XHR, Fetch, cURL):
XHR
- Value of username, password, and headers are not being enclosed in quotes
- Bearer token header is set incorrectly;
'Bearer ' + <token>
Fetch
- Value of final header is not properly closed with quotes;
"headerKey": "headerValue - Authorization token header is not properly closed with quotes;
"Authorization": "Basic <value>,
"Authorization": "Bearer Token <token>, - Bearer token header is set incorrectly;
"Bearer Token <token>" - Generated code is not being enclosed properly i.e. copy and run the code will produce SyntaxError
cURL
- Bearer token header is set incorrectly;
'Bearer Token <value>'
To Reproduce
- Set
Authenticationand add a fewHeaders - Generate code for each request type
Expected behavior
XHR
- Value of username, password, and headers are properly enclosed with quotes
- Bearer token header is set correctly;
'Bearer <token>'
Fetch
- Value of final header is properly closed with quotes;
"headerKey": "headerValue" - Authorization token header is properly closed with quotes;
"Authorization": "Basic <value>",
"Authorization": "Bearer <token>", - Bearer token header is set correctly;
"Bearer <token>"(without the Token) - Generated code is being enclosed properly
cURL
- Bearer token header is set correctly;
'Bearer <value>'(without the Token)
Screenshots
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels