http-form: no empty headers

This commit is contained in:
vanhauser-thc 2022-01-12 10:27:58 +01:00
parent 02ae72c7e7
commit 5a451ba541
2 changed files with 4 additions and 0 deletions

View file

@ -258,6 +258,9 @@ int32_t add_header(ptr_header_node *ptr_head, char *header, char *value, char ty
ptr_header_node cur_ptr = NULL;
ptr_header_node existing_hdr, new_ptr;
if (!header || !value || !strlen(header) || !strlen(value))
return;
// get to the last header
for (cur_ptr = *ptr_head; cur_ptr && cur_ptr->next; cur_ptr = cur_ptr->next)
;