Yeah, this bit of code doesn’t add two headers.
It adds an array of one header, then overrides that header with an array of one header.
So you get one header.
So both headers go in one array and you call setopt with CURLOPPT_HTTPHEADER once with the full array of headers