Skip to content

Commit f4a0aa3

Browse files
committed
Fix tiktoken request
1 parent abb862f commit f4a0aa3

File tree

2 files changed

+201065
-396
lines changed

2 files changed

+201065
-396
lines changed

tests/utils.py

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -7,40 +7,9 @@
77

88

99
def remove_set_cookie_header(response: dict[str, Any]):
10-
"""
11-
Removes the Set-Cookie header from a VCR.py response object to improve cassette consistency.
12-
13-
This function can be used as a before_record callback in your VCR configuration
14-
to ensure that Set-Cookie headers are stripped from responses before they are
15-
recorded to cassettes.
16-
17-
Args:
18-
response (vcr.request.Response): The VCR.py response object to modify
19-
20-
Returns:
21-
vcr.request.Response: The modified response object with Set-Cookie headers removed
22-
23-
Example:
24-
import vcr
25-
26-
# Configure VCR with the callback
27-
vcr = vcr.VCR(
28-
before_record_response=remove_set_cookie_header,
29-
match_on=['uri', 'method']
30-
)
31-
32-
with vcr.use_cassette('tests/fixtures/my_cassette.yaml'):
33-
# Make your HTTP requests here
34-
pass
35-
"""
36-
37-
# Get the headers from the response
3810
headers = response["headers"]
39-
40-
# Headers to remove (case-insensitive)
4111
headers_to_remove = ["set-cookie", "Set-Cookie"]
4212

43-
# Remove Set-Cookie headers if they exist
4413
for header in headers_to_remove:
4514
if header in headers:
4615
del headers[header]

0 commit comments

Comments
 (0)