fix send_error behavior if there are no headers