Skip to content

Commit

Permalink
Fix injecting custom request header in beforeRequest hook
Browse files Browse the repository at this point in the history
  • Loading branch information
seniorquico committed Sep 6, 2024
1 parent e263933 commit 982f8bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"liblabVersion": "2.1.31",
"date": "2024-09-05T21:54:58.569Z",
"date": "2024-09-06T00:38:54.512Z",
"config": {
"apiId": 1126,
"sdkName": "salad-cloud-imds-sdk",
Expand Down Expand Up @@ -155,7 +155,7 @@
},
"multiTenant": true,
"hooksLocation": {
"bucketKey": "7017/hooks.zip",
"bucketKey": "7019/hooks.zip",
"bucketName": "prod-liblab-api-stack-hooks"
},
"includeWatermark": false,
Expand Down
4 changes: 2 additions & 2 deletions src/http/hooks/custom-hook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { HttpRequest, HttpResponse, HttpError } from './hook';
export class CustomHook implements Hook {
public async beforeRequest(request: HttpRequest, params: Map<string, string>): Promise<HttpRequest> {
if (request.headers == null) {
request.headers = {};
request.headers = new Map<string, unknown>();
}

request.headers['Metadata'] = 'true';
request.headers.set('Metadata', 'true');
return request;
}

Expand Down

0 comments on commit 982f8bb

Please sign in to comment.