Skip to content

Commit 6523ab1

Browse files
committed
chore(midway-component-fetch): logging headers only string
1 parent 575833d commit 6523ab1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

  • packages/midway-component-fetch/src/lib

packages/midway-component-fetch/src/lib/helper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ const beforeRequest: FetchComponentConfig['beforeRequest'] = async (options) =>
6060
if (Array.isArray(traceLoggingReqHeaders)) {
6161
traceLoggingReqHeaders.forEach((name) => {
6262
const val = retrieveHeadersItem(opts.headers, name)
63-
if (typeof val !== 'undefined') {
63+
if (val) {
6464
tags[`http.${name}`] = val
6565
}
6666
})
@@ -118,7 +118,7 @@ const afterResponse: FetchComponentConfig['afterResponse'] = async (options) =>
118118
if (Array.isArray(traceLoggingRespHeaders)) {
119119
traceLoggingRespHeaders.forEach((name) => {
120120
const val = retrieveHeadersItem(opts.headers, name)
121-
if (typeof val !== 'undefined') {
121+
if (val) {
122122
tags[`http.${name}`] = val
123123
}
124124
})
@@ -165,7 +165,7 @@ export const processEx: FetchComponentConfig['processEx'] = (options) => {
165165
if (Array.isArray(traceLoggingRespHeaders)) {
166166
traceLoggingRespHeaders.forEach((name) => {
167167
const val = retrieveHeadersItem(opts.headers, name)
168-
if (typeof val !== 'undefined') {
168+
if (val) {
169169
tags[`http.${name}`] = val
170170
}
171171
})

0 commit comments

Comments
 (0)