Custom HTTP Header Content-type

Hi everyone

I am working on an HTTP server on a Cortex-M7 ARM to transmit SOAP messages (with text/xml content) via CGI script, and transmit JSON-AJAX (with application/json content) via CGX script. All HTTP requests are POST requests.
HTTP Headers for CGX scripts are automatically generated via the function netCGX_ContentType(void)

const char* netCGX_ContentType (void)
{
	return("application/json; charset=utf-8");
}


Currently, HTTP headers for CGI scripts return a content-type "text/html" instead of "text/xml".
According to the documentation Common Gateway Interface, documentation, there is a function to change the content type of an HTTP header. It does not work..
(Here's mine function below)

/* Generate http header content-type for cgi call */
const char* netCGI_ContentType (const char *file_ext)
{
	if (strcmp (file_ext, "cgi") == 0) 
	{
		return("text/xml; charset=utf-8\r\n");
	}
	return(NULL);
}

I noticed that the function is never called by the HTTP server. Where should I call the netCGI_ContentType() function to modify its HTTP header?

My set-up :

STM32F769I card
Versions:
HTTP_Server_FS.c: v7.2.0
HTTP_Server_CGI.c: v7.0.0
Net_Config.c: v7.7.0 (variant IPv4 / IPv6 Release)
Net_Config_HTTP_Server.c: v7.0.0"

Thanks,

More questions in this forum