@@ -758,11 +758,16 @@ def test_response_header_capture(self):
758758
759759 def test_request_header_capture (self ):
760760 original_extra_http_headers = agent .options .extra_http_headers
761- agent .options .extra_http_headers = ['X-Capture-This-Too' ]
761+ agent .options .extra_http_headers = ['X-Capture-This-Too' , 'X-Capture-That-Too' ]
762762
763- with tracer .start_active_span ('test' ):
764- r = self .http .request ('GET' , testenv ["wsgi_server" ] + '/' ,
765- headers = {'X-Capture-This-Too' : 'this too' })
763+ request_headers = {
764+ "X-Capture-This-Too" : "this too" ,
765+ "X-Capture-That-Too" : "that too" ,
766+ }
767+ with tracer .start_active_span ("test" ):
768+ r = self .http .request (
769+ "GET" , testenv ["wsgi_server" ] + "/" , headers = request_headers
770+ )
766771
767772 spans = self .recorder .queued_spans ()
768773 self .assertEqual (3 , len (spans ))
@@ -809,5 +814,7 @@ def test_request_header_capture(self):
809814
810815 self .assertIn ("X-Capture-This-Too" , urllib3_span .data ["http" ]["header" ])
811816 self .assertEqual ("this too" , urllib3_span .data ["http" ]["header" ]["X-Capture-This-Too" ])
817+ self .assertIn ("X-Capture-That-Too" , urllib3_span .data ["http" ]["header" ])
818+ self .assertEqual ("that too" , urllib3_span .data ["http" ]["header" ]["X-Capture-That-Too" ])
812819
813- agent .options .extra_http_headers = original_extra_http_headers
820+ agent .options .extra_http_headers = original_extra_http_headers
0 commit comments