Fix #1540 - case sensitive match in mg_is_chunked()

This commit is contained in:
Sergey Lyubka committed 2022-05-16 11:19:45 +01:00
1 parent 2b9f0480a1
commit 27c892806b
2 files changed
+4 -4

No files matched your search

+2 -2
View File
@@ -1804,9 +1804,9 @@ static void walkchunks(struct mg_connection *c, struct mg_http_message *hm,
}
static bool mg_is_chunked(struct mg_http_message *hm) {
struct mg_str needle = mg_str_n("chunked", 7);
const char *needle = "chunked";
struct mg_str *te = mg_http_get_header(hm, "Transfer-Encoding");
return te != NULL && mg_strstr(*te, needle) != NULL;
return te != NULL && mg_vcasecmp(te, needle) == 0;
}
void mg_http_delete_chunk(struct mg_connection *c, struct mg_http_message *hm) {
+2 -2
View File
@@ -810,9 +810,9 @@ static void walkchunks(struct mg_connection *c, struct mg_http_message *hm,
}
static bool mg_is_chunked(struct mg_http_message *hm) {
struct mg_str needle = mg_str_n("chunked", 7);
const char *needle = "chunked";
struct mg_str *te = mg_http_get_header(hm, "Transfer-Encoding");
return te != NULL && mg_strstr(*te, needle) != NULL;
return te != NULL && mg_vcasecmp(te, needle) == 0;
}
void mg_http_delete_chunk(struct mg_connection *c, struct mg_http_message *hm) {