File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
opentelemetry-otlp/src/exporter/http Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -449,13 +449,13 @@ impl<B: HasHttpConfig> WithHttpConfig for B {
449449
450450 fn with_headers ( mut self , headers : HashMap < String , String > ) -> Self {
451451 // headers will be wrapped, so we must do some logic to unwrap first.
452- self . http_client_config ( )
452+ let http_client_headers = self
453+ . http_client_config ( )
453454 . headers
454- . iter_mut ( )
455- . zip ( headers)
456- . for_each ( |( http_client_headers, ( key, value) ) | {
457- http_client_headers. insert ( key, super :: url_decode ( & value) . unwrap_or ( value) ) ;
458- } ) ;
455+ . get_or_insert ( HashMap :: new ( ) ) ;
456+ headers. into_iter ( ) . for_each ( |( key, value) | {
457+ http_client_headers. insert ( key, super :: url_decode ( & value) . unwrap_or ( value) ) ;
458+ } ) ;
459459 self
460460 }
461461}
You can’t perform that action at this time.
0 commit comments