Skip to content

Commit 152f92a

Browse files
committed
[debugger] base64 encode the API key
1 parent 8931872 commit 152f92a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/debugAdapter.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ function getDebuggerInfo(args: IAttachRequestArguments, path: string): Promise<a
113113
path: path,
114114
method: 'GET',
115115
headers: {
116-
'X-Api-Key': args.apiKey,
116+
'X-Api-Key': Buffer.from(args.apiKey).toString('base64'),
117117
}
118118
};
119119

@@ -162,7 +162,7 @@ function sendDebuggerCommand(
162162
): Promise<any> {
163163
return new Promise((resolve, reject) => {
164164
const defaultHeaders: Record<string, string> = {
165-
'X-Api-Key': args.apiKey,
165+
'X-Api-Key': Buffer.from(args.apiKey).toString('base64'),
166166
'Content-Type': path == '/exec' ? 'text/x-lnav-script' : 'application/json',
167167
'Content-Length': Buffer.byteLength(data).toString()
168168
};

0 commit comments

Comments
 (0)