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

Commit

Permalink
fix: Allow spaces in Content-Type
Browse files Browse the repository at this point in the history
The existence of spaces would cause tangle-accelerator is not able to
recognize the header field `Content-Type`
  • Loading branch information
howjmay committed Sep 9, 2020
1 parent 294b978 commit 784f40f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion connectivity/http/http.c
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ static int ta_http_header_iter(void *cls, enum MHD_ValueKind kind, const char *k
ta_http_request_t *header = cls;

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

0 comments on commit 784f40f

Please sign in to comment.