mirror of
https://github.com/warmcat/libwebsockets.git
synced 2025-03-09 00:00:04 +01:00
Changed client handshake to use "Origin" instead of "Sec-WebSocket-Origin" as defined by RFC 6455 when using version 13 of the protocol.
This commit is contained in:
parent
cb19368e14
commit
aa0bc86143
1 changed files with 8 additions and 1 deletions
|
@ -950,9 +950,16 @@ libwebsockets_generate_client_handshake(struct libwebsocket_context *context,
|
|||
strcpy(p, wsi->key_b64);
|
||||
p += strlen(wsi->key_b64);
|
||||
p += sprintf(p, "\x0d\x0a");
|
||||
if (wsi->c_origin)
|
||||
if (wsi->c_origin) {
|
||||
if (wsi->ietf_spec_revision == 13) {
|
||||
p += sprintf(p, "Origin: %s\x0d\x0a",
|
||||
wsi->c_origin);
|
||||
}
|
||||
else {
|
||||
p += sprintf(p, "Sec-WebSocket-Origin: %s\x0d\x0a",
|
||||
wsi->c_origin);
|
||||
}
|
||||
}
|
||||
if (wsi->c_protocol)
|
||||
p += sprintf(p, "Sec-WebSocket-Protocol: %s\x0d\x0a",
|
||||
wsi->c_protocol);
|
||||
|
|
Loading…
Add table
Reference in a new issue