Skip to content

Commit 9430715

Browse files
Tomyomyslendidev
authored andcommitted
Patch Invalid "Host" Header
1 parent c13ba3b commit 9430715

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/neurosdk.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,8 +513,11 @@ NEUROSDK_EXPORT neurosdk_error_e neurosdk_context_create(
513513
goto cleanup2;
514514
}
515515

516+
struct mg_str host = mg_url_host(fetched_url);
517+
unsigned short port = mg_url_port(fetched_url);
516518
context->conn = mg_ws_connect(&context->mgr, fetched_url, connection_fn_,
517-
(void *)context, NULL);
519+
(void *)context, "Host: %.*s:%u\r\n", (int)host.len, host.buf, port);
520+
518521
if (!context->conn) {
519522
res = NeuroSDK_ConnectionError;
520523
goto cleanup3;

0 commit comments

Comments
 (0)