From 6d590b4a5db3699d5d7ece9032247813bfb5b781 Mon Sep 17 00:00:00 2001 From: David Galeano Date: Thu, 10 Jan 2013 10:26:05 +0800 Subject: [PATCH] Added no-cache headers to client handshake: http://www.ietf.org/mail-archive/web/hybi/current/msg09841.html --- lib/libwebsockets.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/libwebsockets.c b/lib/libwebsockets.c index 086ec8f..66112a2 100644 --- a/lib/libwebsockets.c +++ b/lib/libwebsockets.c @@ -853,6 +853,9 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context, p += sprintf(p, "GET %s HTTP/1.1\x0d\x0a", wsi->c_path); + p += sprintf(p, "Pragma: no-cache\x0d\x0a" + "Cache-Control: no-cache\x0d\x0a"); + if (wsi->ietf_spec_revision == 0) { unsigned char spaces_1, spaces_2; unsigned int max_1, max_2; @@ -944,9 +947,9 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context, } p += sprintf(p, "Host: %s\x0d\x0a", wsi->c_host); - p += sprintf(p, "Upgrade: websocket\x0d\x0a"); - p += sprintf(p, "Connection: Upgrade\x0d\x0a" - "Sec-WebSocket-Key: "); + p += sprintf(p, "Upgrade: websocket\x0d\x0a" + "Connection: Upgrade\x0d\x0a" + "Sec-WebSocket-Key: "); strcpy(p, wsi->key_b64); p += strlen(wsi->key_b64); p += sprintf(p, "\x0d\x0a"); -- 2.7.4