1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

websocket: fix format selection

This commit is contained in:
Steffen Vogel 2018-05-14 18:53:28 +02:00
parent 6002d8fa04
commit 7dc66355f3

View file

@ -152,7 +152,7 @@ int websocket_protocol_cb(struct lws *wsi, enum lws_callback_reasons reason, voi
format = strtok(NULL, "");
if (!format)
format = "villas-web";
format = "villas.web";
/* Search for node whose name matches the URI. */
c->node = list_lookup(&p.node.instances, node);
@ -162,7 +162,7 @@ int websocket_protocol_cb(struct lws *wsi, enum lws_callback_reasons reason, voi
}
struct format_type *fmt = format_type_lookup(format);
if (fmt) {
if (!fmt) {
websocket_connection_close(c, wsi, LWS_CLOSE_STATUS_PROTOCOL_ERR, "Invalid format");
return -1;
}