1
0
Fork 0
mirror of https://github.com/warmcat/libwebsockets.git synced 2025-03-09 00:00:04 +01:00

multipart: quote boundary

https://github.com/warmcat/libwebsockets/issues/1948
This commit is contained in:
Andy Green 2020-06-12 07:22:59 +01:00
parent 7840d455bb
commit 9b24e29b9a
3 changed files with 5 additions and 3 deletions

View file

@ -327,7 +327,7 @@ set(PACKAGE "libwebsockets")
set(CPACK_PACKAGE_NAME "${PACKAGE}")
set(CPACK_PACKAGE_VERSION_MAJOR "4")
set(CPACK_PACKAGE_VERSION_MINOR "0")
set(CPACK_PACKAGE_VERSION_PATCH "15")
set(CPACK_PACKAGE_VERSION_PATCH "16")
set(CPACK_PACKAGE_RELEASE 1)
set(CPACK_GENERATOR "RPM")
set(CPACK_PACKAGE_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")

View file

@ -989,7 +989,7 @@ lws_http_multipart_headers(struct lws *wsi, uint8_t *p)
wsi->http.multipart_boundary,
sizeof(wsi->http.multipart_boundary));
n = lws_snprintf(arg, sizeof(arg), "multipart/form-data; boundary=%s",
n = lws_snprintf(arg, sizeof(arg), "multipart/form-data; boundary=\"%s\"",
wsi->http.multipart_boundary);
if (lws_add_http_header_by_token(wsi, WSI_TOKEN_HTTP_CONTENT_TYPE,

View file

@ -138,8 +138,10 @@ lws_urldecode_s_create(struct lws_spa *spa, struct lws *wsi, char *out,
s->mime_boundary[m++] = '\x0a';
s->mime_boundary[m++] = '-';
s->mime_boundary[m++] = '-';
if (*p == '\"')
p++;
while (m < (int)sizeof(s->mime_boundary) - 1 &&
*p && *p != ' ' && *p != ';')
*p && *p != ' ' && *p != ';' && *p != '\"')
s->mime_boundary[m++] = *p++;
s->mime_boundary[m] = '\0';