Fix WS connections to URLs that don't end in /

Same as in mg_connect_http_opt().
This commit is contained in:
Deomid Ryabkov 2022-08-03 14:39:55 +01:00
parent 0c4d364cee
commit a1fcbb0718
2 changed files with 4 additions and 2 deletions

View File

@ -10257,7 +10257,7 @@ void mg_send_websocket_handshake3(struct mg_connection *nc, const char *path,
}
void mg_send_websocket_handshake3v(struct mg_connection *nc,
const struct mg_str path,
const struct mg_str path_in,
const struct mg_str host,
const struct mg_str protocol,
const struct mg_str extra_headers,
@ -10276,6 +10276,7 @@ void mg_send_websocket_handshake3v(struct mg_connection *nc,
if (user.len > 0) {
mg_basic_auth_header(user, pass, &auth);
}
const struct mg_str path = (path_in.len > 0 ? path_in : mg_mk_str("/"));
/*
* NOTE: the (auth.buf == NULL ? "" : auth.buf) is because cc3200 libc is

View File

@ -424,7 +424,7 @@ void mg_send_websocket_handshake3(struct mg_connection *nc, const char *path,
}
void mg_send_websocket_handshake3v(struct mg_connection *nc,
const struct mg_str path,
const struct mg_str path_in,
const struct mg_str host,
const struct mg_str protocol,
const struct mg_str extra_headers,
@ -443,6 +443,7 @@ void mg_send_websocket_handshake3v(struct mg_connection *nc,
if (user.len > 0) {
mg_basic_auth_header(user, pass, &auth);
}
const struct mg_str path = (path_in.len > 0 ? path_in : mg_mk_str("/"));
/*
* NOTE: the (auth.buf == NULL ? "" : auth.buf) is because cc3200 libc is