Cloudfare returning Misleading error response

After Aug-7 update to ZATCA servers (adding Cloudfare, etc), ZATCA clearance/reporting APIs failed with following response.

Error Code: 415 Message: Unsupported Media Type Data: {"Message":"Content-Type is not supported or not provided, please ensure that the request header includes the Content-Type set to 'application/json'","Code":"Invalid-Request","Reason":"Unsupported Media Type"}

I was setting the Content-Type header correctly and re-confirmed it by dumping the request. The real issue turned out to be duplicate ‘Content-type’ header. (I was setting it once and framework added another one before sending request).

Before adding cloudfare, the zatca servers were tolerant of the duplicate header. It took almost a week to identify and fix this. Should have been an easy fix if proper error message was given by cloudfare servers.