diff --git a/main/http.c b/main/http.c index 0e45b60db6..e2982a73b5 100644 --- a/main/http.c +++ b/main/http.c @@ -880,12 +880,16 @@ struct ast_json *ast_http_get_json( } buf = ast_http_get_contents(&content_length, ser, headers); - if (buf == NULL) - { + if (buf == NULL) { /* errno already set */ return NULL; } + if (!content_length) { + /* it is not an error to have zero content */ + return NULL; + } + body = ast_json_load_buf(buf, content_length, NULL); if (body == NULL) { /* Failed to parse JSON; treat as an I/O error */