Skip to content

Commit d9269d3

Browse files
committed
Minor fixes
1 parent df51f9f commit d9269d3

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

src/appsec/event-data-extractor.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ function extractFromApiGatewayV1(event: any): ExtractedHTTPData {
4040
const result: ExtractedHTTPData = {
4141
headers: headersNoCookies,
4242
method: event.httpMethod || "",
43-
path: event.path || event.requestContext?.path || "/",
43+
path: event.requestContext?.path || event.path || "/",
4444
query: mergeQueryParams(event.queryStringParameters, event.multiValueQueryStringParameters),
4545
body: decodeBody(event.body, event.isBase64Encoded),
4646
isBase64Encoded: !!event.isBase64Encoded,

src/appsec/index.spec.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,12 @@ describe("AppSec orchestrator", () => {
132132

133133
it("should not publish when event is not an HTTP trigger", () => {
134134
mockExtract.mockReturnValue(undefined as any);
135+
const span = { setTag: jest.fn() };
136+
137+
processAppsecRequest({}, span);
135138

136-
processAppsecRequest({}, {});
137139
expect(mockPublish).not.toHaveBeenCalled();
140+
expect(span.setTag).toHaveBeenCalledWith("_dd.appsec.unsupported_event_type", 1);
138141
});
139142

140143
it("should publish extracted HTTP data to the start-invocation channel", () => {

0 commit comments

Comments
 (0)