Skip to content

Commit 6a25584

Browse files
authored
[mod_curl] fixes 'Unparsable header' error message on HTTP/2 200 reply
1 parent 6a13dee commit 6a25584

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/mod/applications/mod_curl/mod_curl.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,10 @@ static char *print_json(switch_memory_pool_t *pool, http_data_t *http_data)
381381
if (argc > 2) {
382382
cJSON_AddItemToObject(top, "version", cJSON_CreateString(argv[0]));
383383
cJSON_AddItemToObject(top, "phrase", cJSON_CreateString(argv[2]));
384+
} else if (argc == 2 && strcmp(argv[0], "HTTP/2") == 0) {
385+
/* HTTP/2 responses may not include a phrase */
386+
cJSON_AddItemToObject(top, "version", cJSON_CreateString(argv[0]));
387+
cJSON_AddItemToObject(top, "phrase", cJSON_CreateString(""));
384388
} else {
385389
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Unparsable header: argc: %d\n", argc);
386390
}

0 commit comments

Comments
 (0)