1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

http client: add flag to disable redir follow

This commit is contained in:
Zevv 2020-01-21 13:27:36 +00:00 committed by Andy Green
parent e6f3aafe13
commit b09b416b1d
4 changed files with 5 additions and 1 deletions

View file

@ -47,6 +47,7 @@ enum lws_client_connect_ssl_connection_flags {
LCCSCF_H2_MANUAL_RXFLOW = (1 << 9),
LCCSCF_HTTP_MULTIPART_MIME = (1 << 10),
LCCSCF_HTTP_X_WWW_FORM_URLENCODED = (1 << 11),
LCCSCF_HTTP_NO_FOLLOW_REDIRECT = (1 << 12),
LCCSCF_PIPELINE = (1 << 16),
/**< Serialize / pipeline multiple client connections

View file

@ -158,6 +158,8 @@ lws_client_connect_via_info(const struct lws_client_connect_info *i)
wsi->protocol = &wsi->vhost->protocols[0];
wsi->client_pipeline = !!(i->ssl_connection & LCCSCF_PIPELINE);
wsi->client_no_follow_redirect = !!(i->ssl_connection &
LCCSCF_HTTP_NO_FOLLOW_REDIRECT);
/*
* PHASE 5: handle external user_space now, generic alloc is done in

View file

@ -800,6 +800,7 @@ struct lws {
unsigned int client_mux_substream:1;
unsigned int client_mux_migrated:1;
unsigned int client_subsequent_mime_part:1;
unsigned int client_no_follow_redirect:1;
#endif
#ifdef _WIN32

View file

@ -802,7 +802,7 @@ lws_client_interpret_server_handshake(struct lws *wsi)
if (ah)
ah->http_response = n;
if (
if (!wsi->client_no_follow_redirect &&
#if defined(LWS_WITH_HTTP_PROXY)
!wsi->http.proxy_clientside &&
#endif