Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 784f40f

Browse files
committed
fix: Allow spaces in Content-Type
The existence of spaces would cause tangle-accelerator is not able to recognize the header field `Content-Type`
1 parent 294b978 commit 784f40f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

connectivity/http/http.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ static int ta_http_header_iter(void *cls, enum MHD_ValueKind kind, const char *k
289289
ta_http_request_t *header = cls;
290290

291291
if (0 == strncasecmp(MHD_HTTP_HEADER_CONTENT_TYPE, key, strlen(MHD_HTTP_HEADER_CONTENT_TYPE))) {
292-
if (api_path_matcher(value, "application/json(;?\\s*charset=(UTF|utf)-8)?") == SC_OK) {
292+
if (api_path_matcher(value, "application/json\\s*(;?\\s*charset\\s*=\\s*(UTF|utf)-8)?") == SC_OK) {
293293
header->valid_content_type = true;
294294
} else {
295295
header->valid_content_type = false;

0 commit comments

Comments
 (0)