File tree Expand file tree Collapse file tree
packages/midway-component-fetch/src/lib Expand file tree Collapse file tree Original file line number Diff line number Diff 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 } )
You can’t perform that action at this time.
0 commit comments