mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-07 07:37:02 +02:00
MINOR: httpclient: allow to use absolute URI with new flag HC_F_HTTPROXY
The new HC_F_HTTPPROXY flag allows to use an absolute URI within a request that won't be modified in order to use an http proxy.
This commit is contained in:
parent
9bdce67585
commit
95949e6868
@ -64,6 +64,7 @@ enum {
|
|||||||
#define HC_F_RES_HDR 0x02
|
#define HC_F_RES_HDR 0x02
|
||||||
#define HC_F_RES_BODY 0x04
|
#define HC_F_RES_BODY 0x04
|
||||||
#define HC_F_RES_END 0x08
|
#define HC_F_RES_END 0x08
|
||||||
|
#define HC_F_HTTPPROXY 0x10
|
||||||
|
|
||||||
|
|
||||||
#endif /* ! _HAPROXY_HTTCLIENT__T_H */
|
#endif /* ! _HAPROXY_HTTCLIENT__T_H */
|
||||||
|
@ -277,10 +277,13 @@ int httpclient_req_gen(struct httpclient *hc, const struct ist url, enum http_me
|
|||||||
struct htx *htx;
|
struct htx *htx;
|
||||||
int err_code = 0;
|
int err_code = 0;
|
||||||
struct ist meth_ist, vsn;
|
struct ist meth_ist, vsn;
|
||||||
unsigned int flags = HTX_SL_F_VER_11 | HTX_SL_F_NORMALIZED_URI | HTX_SL_F_HAS_SCHM;
|
unsigned int flags = HTX_SL_F_VER_11 | HTX_SL_F_HAS_SCHM | HTX_SL_F_HAS_AUTHORITY;
|
||||||
int i;
|
int i;
|
||||||
int foundhost = 0, foundaccept = 0, foundua = 0;
|
int foundhost = 0, foundaccept = 0, foundua = 0;
|
||||||
|
|
||||||
|
if (!(hc->flags & HC_F_HTTPPROXY))
|
||||||
|
flags |= HTX_SL_F_NORMALIZED_URI;
|
||||||
|
|
||||||
if (!b_alloc(&hc->req.buf))
|
if (!b_alloc(&hc->req.buf))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user