mirror of
https://github.com/curl/curl.git
synced 2026-08-26 00:23:32 +03:00
http: do not send PROXY more than once
Unlike `CONNECT`, currently we don't keep track whether `PROXY` is already sent or not. This causes `PROXY` header to be sent twice during `MSTATE_TUNNELING` and `MSTATE_PROTOCONNECT`. Closes #9878 Fixes #9442
This commit is contained in:
parent
6d75115406
commit
11ad25fff4
2 changed files with 8 additions and 1 deletions
|
|
@ -1572,11 +1572,14 @@ CURLcode Curl_http_connect(struct Curl_easy *data, bool *done)
|
|||
/* nothing else to do except wait right now - we're not done here. */
|
||||
return CURLE_OK;
|
||||
|
||||
if(data->set.haproxyprotocol) {
|
||||
if(data->set.haproxyprotocol && !data->state.is_haproxy_hdr_sent) {
|
||||
/* add HAProxy PROXY protocol header */
|
||||
result = add_haproxy_protocol_header(data);
|
||||
if(result)
|
||||
return result;
|
||||
|
||||
/* do not send the header again after successful try */
|
||||
data->state.is_haproxy_hdr_sent = TRUE;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue