From 44e260e004a414cd7d1ec3f36cc6bd4f25cdfdae Mon Sep 17 00:00:00 2001 From: u0u0 Date: Fri, 25 Oct 2013 17:13:11 +0800 Subject: [PATCH] fix origin And fix client header of Origin, add prefix "http://" to make a valid URI, to make golang websocket server happy. --- lib/client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client.c b/lib/client.c index 838dbf5f..c81f6413 100644 --- a/lib/client.c +++ b/lib/client.c @@ -849,7 +849,7 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context, p += strlen(key_b64); p += sprintf(p, "\x0d\x0a"); if (lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_ORIGIN)) - p += sprintf(p, "Origin: %s\x0d\x0a", + p += sprintf(p, "Origin: http://%s\x0d\x0a", lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_ORIGIN)); if (lws_hdr_simple_ptr(wsi, _WSI_TOKEN_CLIENT_SENT_PROTOCOLS))