From: brianomchugh Date: Wed, 21 May 2025 09:35:22 +0000 (-0400) Subject: [mod_curl] fixes 'Unparsable header' error message on HTTP/2 200 reply X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6a25584da25e621438ee401de3666c2b42d8a794;p=thirdparty%2Ffreeswitch.git [mod_curl] fixes 'Unparsable header' error message on HTTP/2 200 reply --- diff --git a/src/mod/applications/mod_curl/mod_curl.c b/src/mod/applications/mod_curl/mod_curl.c index cae06bdb30..d443ae4adc 100644 --- a/src/mod/applications/mod_curl/mod_curl.c +++ b/src/mod/applications/mod_curl/mod_curl.c @@ -381,6 +381,10 @@ static char *print_json(switch_memory_pool_t *pool, http_data_t *http_data) if (argc > 2) { cJSON_AddItemToObject(top, "version", cJSON_CreateString(argv[0])); cJSON_AddItemToObject(top, "phrase", cJSON_CreateString(argv[2])); + } else if (argc == 2 && strcmp(argv[0], "HTTP/2") == 0) { + /* HTTP/2 responses may not include a phrase */ + cJSON_AddItemToObject(top, "version", cJSON_CreateString(argv[0])); + cJSON_AddItemToObject(top, "phrase", cJSON_CreateString("")); } else { switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unparsable header: argc: %d\n", argc); }