This commit is contained in:
Clarence 2025-01-31 16:48:23 +00:00 committed by GitHub
commit e332c8b9dc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 3 deletions

View File

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