-
-
Notifications
You must be signed in to change notification settings - Fork 565
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Handle python session requests/response in modify_chunk_response plugin #1352
Comments
@abhinavsingh Can we confirm that this is a known issue? |
@noorul @ananth-sivam This will need some investigation. Last time I checked, pipelines requests were well supported. But afaik, there is no exhaustive test suite to keep pipeline support intact and it "may" have gone broke. I'll try and dig into it this month. |
Thank you @abhinavsingh. For now I have overwritten the request/response state to httpParserStates.INITIALIZED and request.headers to None, after each request/response completion in the pipeline |
Discussed in #1351
Originally posted by ananth-sivam September 27, 2023
@abhinavsingh
I have used the modify_chunk_response plugin to modify an upstream response header and publish it to client.
Here the client is using python requests.Session() to do GET/POST/PUT via https.
Below is the UT that I have to mimick the client and the last assert is failing as
assert 'https://httpbin.org/get' == 'https://httpbin.org/post'
UT
session = requests.Session()
r1 = session.get( "https://httpbin.org/get", proxies={"https": "http://127.0.0.1:8899"}, verify=False, )
assert r1.json().get("url") == "https://httpbin.org/get"
r2 = session.post( "https://httpbin.org/post", proxies={"https": "http://127.0.0.1:8899"}, verify=False, )
assert r2.json().get("url") == 'https://httpbin.org/post'
OR below was executed after starting the
python -m proxy --plugins proxy.plugin.ModifyChunkResponsePlugin
Below is the print output
R1: http://httpbin.org/get
R2: http://httpbin.org/get
proxy version: 2.4.3
Facing a similar issue on the pipeline_request side also. Client published a GET call followed with a POST method call using requests.Session.
But proxy passing the GET request to the handle_client_request method for the POST call also.
Any help is appreciated.
The text was updated successfully, but these errors were encountered: