Skip to content

Commit c340370

Browse files
committed
Re-apploy _logHttpRequest
1 parent a4c3336 commit c340370

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

src/trace/patch-http.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ function patchMethod(mod: typeof http | typeof https, method: "get" | "request",
3737
const fn = (arg1: any, arg2: any, arg3: any) => {
3838
[arg1, arg2, arg3] = addTraceContextToArgs(contextService, arg1, arg2, arg3);
3939

40-
/*if (isIntegrationTest()) {
41-
_logHttpRequest(requestOpts);
42-
}*/
4340
if (arg3 === undefined || arg3 === null) {
4441
return original(arg1, arg2)
4542
} else {
@@ -103,10 +100,14 @@ function getRequestOptionsWithTraceContext(
103100
...headers,
104101
...traceHeaders,
105102
};
106-
return {
103+
const requestOpts = {
107104
...options,
108105
headers,
109106
};
107+
if (isIntegrationTest()) {
108+
_logHttpRequest(requestOpts);
109+
}
110+
return requestOpts;
110111
}
111112

112113
function isIntegrationTest() {

0 commit comments

Comments
 (0)