mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-17 19:30:36 +00:00
Fix WS connections to URLs that don't end in /
Same as in mg_connect_http_opt().
This commit is contained in:
1 parent
0c4d364cee
commit
a1fcbb0718
2 files changed
+4
-2
No files matched your search
+2
-1
@@ -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,
|
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 host,
|
||||||
const struct mg_str protocol,
|
const struct mg_str protocol,
|
||||||
const struct mg_str extra_headers,
|
const struct mg_str extra_headers,
|
||||||
@@ -10276,6 +10276,7 @@ void mg_send_websocket_handshake3v(struct mg_connection *nc,
|
|||||||
if (user.len > 0) {
|
if (user.len > 0) {
|
||||||
mg_basic_auth_header(user, pass, &auth);
|
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
|
* NOTE: the (auth.buf == NULL ? "" : auth.buf) is because cc3200 libc is
|
||||||
|
|||||||
@@ -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,
|
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 host,
|
||||||
const struct mg_str protocol,
|
const struct mg_str protocol,
|
||||||
const struct mg_str extra_headers,
|
const struct mg_str extra_headers,
|
||||||
@@ -443,6 +443,7 @@ void mg_send_websocket_handshake3v(struct mg_connection *nc,
|
|||||||
if (user.len > 0) {
|
if (user.len > 0) {
|
||||||
mg_basic_auth_header(user, pass, &auth);
|
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
|
* NOTE: the (auth.buf == NULL ? "" : auth.buf) is because cc3200 libc is
|
||||||
|
|||||||
Reference in new issue
Block a user