From 9e018fa4a221fc73c19486b22bbdf241e2984ef9 Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Sat, 12 Jan 2019 19:06:23 +0100 Subject: [PATCH] websocket: properly parse payload format for client connections --- lib/nodes/websocket.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/nodes/websocket.c b/lib/nodes/websocket.c index 220462f29..731e01390 100644 --- a/lib/nodes/websocket.c +++ b/lib/nodes/websocket.c @@ -405,10 +405,12 @@ int websocket_start(struct node *n) c->state = WEBSOCKET_CONNECTION_STATE_CONNECTING; format = strchr(d->info.path, '.'); - if (!format) + if (format) + format = format + 1; // remove "." + else format = "villas.web"; - c->format = format_type_lookup(format + 1); + c->format = format_type_lookup(format); if (!c->format) return -1;