@@ -542,10 +542,10 @@ def set_function_recording_options(**kwargs) -> None:
542
542
This must be called during test case execution, rather than at a session, module, or class level. To set recording
543
543
options for all tests, use `set_session_recording_options` instead.
544
544
545
- :keyword bool handle_redirects: The test proxy does not perform transparent follow directs by default. That means
545
+ :keyword bool handle_redirects: The test proxy performs transparent follow directs by default. That means
546
546
that if the initial request sent through the test proxy results in a 3XX redirect status, the test proxy will
547
- not follow. It will return that redirect response to the client and allow it to handle the redirect. Setting
548
- `handle_redirects` to True will set the proxy to instead handle redirects itself .
547
+ follow. Setting `handle_redirects` to False will instead make the test proxy return that redirect response to
548
+ the client and allow it to handle the redirect .
549
549
:keyword str context_directory: This changes the "root" path that the test proxy uses when loading a recording.
550
550
:keyword certificates: A list of `PemCertificate`s. Any number of certificates is allowed.
551
551
:type certificates: Iterable[PemCertificate]
@@ -564,10 +564,10 @@ def set_session_recording_options(**kwargs) -> None:
564
564
This will set the specified recording options for an entire test session. To set recording options for a single test
565
565
-- which is recommended -- use `set_function_recording_options` instead.
566
566
567
- :keyword bool handle_redirects: The test proxy does not perform transparent follow directs by default. That means
567
+ :keyword bool handle_redirects: The test proxy performs transparent follow directs by default. That means
568
568
that if the initial request sent through the test proxy results in a 3XX redirect status, the test proxy will
569
- not follow. It will return that redirect response to the client and allow it to handle the redirect. Setting
570
- `handle_redirects` to True will set the proxy to instead handle redirects itself .
569
+ follow. Setting `handle_redirects` to False will instead make the test proxy return that redirect response to
570
+ the client and allow it to handle the redirect .
571
571
:keyword str context_directory: This changes the "root" path that the test proxy uses when loading a recording.
572
572
:keyword certificates: A list of `PemCertificate`s. Any number of certificates is allowed.
573
573
:type certificates: Iterable[PemCertificate]
@@ -703,10 +703,11 @@ def _send_recording_options_request(parameters: Dict, headers: Optional[Dict] =
703
703
if is_live_and_not_recording ():
704
704
return
705
705
706
- headers_to_send = {}
707
- for key in headers :
708
- if headers [key ] is not None :
709
- headers_to_send [key ] = headers [key ]
706
+ headers_to_send = {"Content-Type" : "application/json" }
707
+ if headers :
708
+ for key in headers :
709
+ if headers [key ] is not None :
710
+ headers_to_send [key ] = headers [key ]
710
711
711
712
http_client = get_http_client ()
712
713
http_client .request (
@@ -752,9 +753,10 @@ def _send_sanitizer_request(sanitizer: str, parameters: Dict, headers: Optional[
752
753
return
753
754
754
755
headers_to_send = {"x-abstraction-identifier" : sanitizer , "Content-Type" : "application/json" }
755
- for key in headers :
756
- if headers [key ] is not None :
757
- headers_to_send [key ] = headers [key ]
756
+ if headers :
757
+ for key in headers :
758
+ if headers [key ] is not None :
759
+ headers_to_send [key ] = headers [key ]
758
760
759
761
http_client = get_http_client ()
760
762
http_client .request (
@@ -778,9 +780,10 @@ def _send_transform_request(transform: str, parameters: Dict, headers: Optional[
778
780
return
779
781
780
782
headers_to_send = {"x-abstraction-identifier" : transform , "Content-Type" : "application/json" }
781
- for key in headers :
782
- if headers [key ] is not None :
783
- headers_to_send [key ] = headers [key ]
783
+ if headers :
784
+ for key in headers :
785
+ if headers [key ] is not None :
786
+ headers_to_send [key ] = headers [key ]
784
787
785
788
http_client = get_http_client ()
786
789
http_client .request (
0 commit comments