Closed momala454 closed 2 years ago
even if I set "Host: hello.com" on the second request, it still send "abc.com" as host when i'm using CURL_IMPERSONATE
hello, did you saw this issue ?
Hi, yes I saw it. Thanks for reporting. My time was quite limited the past week so I didn't manage to inspect this yet.
Ok thanks for your hard work
hello, could you please look at it, this issue is preventing me to use it. The others issue I mentioned are less important thank you
I will prioritize it, I might have some free time next week. Sorry for the delay, busy times...
By the way, I understand the need for reusing the curl handle when connecting to the same host, but what is the purpose if you are connecting to a different one? A new connection is initiated, so why not use a new handle?
I have a generic http query to do request and sometimes it will be on different host but sometime the same. Thank you
@momala454 I think I fixed the issue in #62 . I tested the fix using C code, would you mind testing it with your PHP code as well? Once you give me the green light I would merge it to the main branch.
The issue was quite tricky - you found a real edge case here. Luckily the fix was simple.
@momala454 not related to this issue, But can you tell how are you able to use chrome98 as curl handler in PHP ? I dont this using putenv('CURL_IMPERSONATE=chrome98');
is enough right ?
@foremtehan yes it's enough as soon as you use the libcurl from this library instead of the default one
@momala454 I think I fixed the issue in #62 . I tested the fix using C code, would you mind testing it with your PHP code as well? Once you give me the green light I would merge it to the main branch.
The issue was quite tricky - you found a real edge case here. Luckily the fix was simple.
thanks for the fix. I've tested and it worked fine. Take note that I tested with both https://github.com/lwthiker/curl-impersonate/pull/62 and https://github.com/lwthiker/curl-impersonate/pull/44 at the same time
When using libcurl and reusing the same connection, if I set the "Host:" header on the connection, and reuse it to make a request without the host header, the header is still included with the same value
ON the first request, this is what is sent
and this is sent on the second request
if i remove the line
putenv('CURL_IMPERSONATE=chrome98');
, everything works fine : first request :second request