Added no-cache headers to client handshake: 66/2866/1
authorDavid Galeano <davidgaleano@turbulenz.biz>
Thu, 10 Jan 2013 02:26:05 +0000 (10:26 +0800)
committerKevron Rees <kevron_m_rees@linux.intel.com>
Thu, 7 Mar 2013 21:01:23 +0000 (13:01 -0800)
http://www.ietf.org/mail-archive/web/hybi/current/msg09841.html

lib/libwebsockets.c

index 086ec8f..66112a2 100644 (file)
@@ -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");