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

client: flag defeating default cache-control headers added

This commit is contained in:
Ilya Smelykh 2021-11-11 23:27:12 +07:00 committed by Andy Green
parent c8811bfe48
commit d425691d9f
2 changed files with 5 additions and 3 deletions

View file

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

View file

@ -1195,9 +1195,10 @@ lws_generate_client_handshake(struct lws *wsi, char *pkt)
p += lws_snprintf(p, lws_ptr_diff_size_t(end, p),
"%s %s HTTP/1.1\x0d\x0a", meth, path);
p += lws_snprintf(p, lws_ptr_diff_size_t(end, p),
"Pragma: no-cache\x0d\x0a"
"Cache-Control: no-cache\x0d\x0a");
if (!(wsi->flags & LCCSCF_HTTP_NO_CACHE_CONTROL))
p += lws_snprintf(p, lws_ptr_diff_size_t(end, p),
"Pragma: no-cache\x0d\x0a"
"Cache-Control: no-cache\x0d\x0a");
p += lws_snprintf(p, lws_ptr_diff_size_t(end, p),
"Host: %s\x0d\x0a",