From 6a25584da25e621438ee401de3666c2b42d8a794 Mon Sep 17 00:00:00 2001 From: brianomchugh Date: Wed, 21 May 2025 05:35:22 -0400 Subject: [PATCH] [mod_curl] fixes 'Unparsable header' error message on HTTP/2 200 reply --- src/mod/applications/mod_curl/mod_curl.c | 4 ++++ 1 file changed, 4 insertions(+) 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); } -- 2.47.2