Skip to content
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

Persistent connection sends previous body when new body is not set #458

Open
Pavel-Guseynov opened this issue Nov 25, 2024 · 0 comments
Open

Comments

@Pavel-Guseynov
Copy link

Hi!

When using a persistent connection (reusing curl), if the request body for a new request is not explicitly set, the body from the previous request is sent instead of being cleared. This behavior leads to unexpected data being transmitted, potentially causing incorrect results or data leakage.

How to Reproduce:

curl = Curl::Easy.new
curl.url = "https://webhook.site/get-your-testing-address" 
curl.post('example data') 
# HTTP body will be 'example data'
curl.post
# HTTP body will be 'example data' instead '' (nil) 

Expected Behavior:
The body of the new request should be empty

Actual Behavior:
The body of the previous request is sent, resulting in unintended data being included in the new request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant