[mod_curl] remove phrase check in http response

This commit is contained in:
Clarence 2022-02-23 11:25:18 +08:00
parent 7fb158ae6a
commit 6bdb1e0d8a
1 changed files with 1 additions and 3 deletions

View File

@ -369,11 +369,9 @@ static char *print_json(switch_memory_pool_t *pool, http_data_t *http_data)
char *argv[3] = { 0 }; char *argv[3] = { 0 };
int argc; int argc;
if ((argc = switch_separate_string(header->data, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) { if ((argc = switch_separate_string(header->data, ' ', argv, (sizeof(argv) / sizeof(argv[0]))))) {
cJSON_AddItemToObject(top, "version", cJSON_CreateString(argv[0]));
if (argc > 2) { if (argc > 2) {
cJSON_AddItemToObject(top, "version", cJSON_CreateString(argv[0]));
cJSON_AddItemToObject(top, "phrase", cJSON_CreateString(argv[2])); cJSON_AddItemToObject(top, "phrase", cJSON_CreateString(argv[2]));
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unparsable header: argc: %d\n", argc);
} }
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Starts with HTTP but not parsable: %s\n", header->data); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Starts with HTTP but not parsable: %s\n", header->data);