From c7f96e1a974799c369e34c2369385f465d70c2cf Mon Sep 17 00:00:00 2001 From: Steffen Vogel Date: Wed, 30 Sep 2020 16:07:39 +0200 Subject: [PATCH] websockets: add missing slash in destination path --- lib/nodes/websocket.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/nodes/websocket.cpp b/lib/nodes/websocket.cpp index 6e3aad0b3..845c89b46 100644 --- a/lib/nodes/websocket.cpp +++ b/lib/nodes/websocket.cpp @@ -236,7 +236,7 @@ int websocket_protocol_cb(struct lws *wsi, enum lws_callback_reasons reason, voi ret = websocket_connection_init(c); if (ret) { websocket_connection_close(c, wsi, LWS_CLOSE_STATUS_POLICY_VIOLATION, "Internal error"); - warning("Failed to intialize websocket connection: reason=%d", ret); + warning("Failed to intialize WebSocket connection: reason=%d", ret); return -1; } @@ -569,7 +569,7 @@ int websocket_parse(struct vnode *n, json_t *cfg) d->info.ssl_connection = !strcmp(prot, "https"); d->info.address = strdup(ads); - d->info.path = strdup(path); + d->info.path = strf("/%s", path); d->info.host = d->info.address; d->info.origin = d->info.address; d->info.ietf_version_or_minus_one = -1;