File tree Expand file tree Collapse file tree 3 files changed +14
-1
lines changed
Expand file tree Collapse file tree 3 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -465,7 +465,8 @@ async def proxy_request(
465465 )
466466
467467 target_url = _url_path_join (provider_base_urls [provider ], remaining_path )
468- headers = {key : value for key , value in request .headers .items () if key != "Host" }
468+ skip_headers = {"host" , "transfer-encoding" }
469+ headers = {key : value for key , value in request .headers .items () if not (key .lower () in skip_headers )}
469470
470471 request_kwargs : Dict [str , Any ] = {
471472 "method" : request .method ,
Original file line number Diff line number Diff line change 1+ ---
2+ fixes :
3+ - |
4+ Ignores the Transfer-Encoding header in proxied vcr requests, forwarding this header can lead to failures in
5+ downstream services.
Original file line number Diff line number Diff line change @@ -276,3 +276,10 @@ async def test_vcr_proxy_converts_legacy_vcr_cassette_to_json(
276276 assert os .path .exists (os .path .join (vcr_cassettes_directory , "custom" , cassette_file ))
277277
278278 assert not os .path .exists (vcr_legacy_cassette )
279+
280+
281+ async def test_vcr_proxy_with_chunked_request (agent : TestClient [Any , Any ], vcr_cassettes_directory : str ) -> None :
282+ resp = await agent .post ("/vcr/custom/serve" , json = {"foo" : "bar" }, chunked = True )
283+
284+ assert resp .status == 200
285+ assert await resp .text () == "OK"
You can’t perform that action at this time.
0 commit comments