diff --git a/changelog b/changelog
index c226613b5b424e62a651f37b56415e3d7069edaf..f86085715d5197bb23d0de96d2bedc1e4e5ef06f 100644
--- a/changelog
+++ b/changelog
@@ -38,6 +38,7 @@ using up the pool.
 
 8) MAJOR windows-only-POLLHUP was not coming
 
+9) Client should not send ext hdr if no exts
 
 Changes
 -------
diff --git a/lib/client.c b/lib/client.c
index bb84d17274d3ecf3143b5a9a1379e590da578b71..fdf1eff2eb1e863fab2ef8ccababa85bd2ebf31b 100644
--- a/lib/client.c
+++ b/lib/client.c
@@ -1081,7 +1081,6 @@ lws_generate_client_handshake(struct lws *wsi, char *pkt)
 
 		/* tell the server what extensions we could support */
 
-		p += sprintf(p, "Sec-WebSocket-Extensions: ");
 #ifndef LWS_NO_EXTENSIONS
 		ext = context->extensions;
 		while (ext && ext->callback) {
@@ -1113,13 +1112,16 @@ lws_generate_client_handshake(struct lws *wsi, char *pkt)
 
 			if (ext_count)
 				*p++ = ',';
+			else
+				p += sprintf(p, "Sec-WebSocket-Extensions: ");
 			p += sprintf(p, "%s", ext->client_offer);
 			ext_count++;
 
 			ext++;
 		}
+		if (ext_count)
+			p += sprintf(p, "\x0d\x0a");
 #endif
-		p += sprintf(p, "\x0d\x0a");
 
 		if (wsi->ietf_spec_revision)
 			p += sprintf(p, "Sec-WebSocket-Version: %d\x0d\x0a",