Need additional Access-Control Header parameter for CORS

Hi there, I am trying to use the API to get JSON data for use with ExtJS front end. I was able to get the cross-domain working, but I need to add an addtional header:

header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept");

I was able to get everything working if I hardcode that line in ‘core\API\CORSHandler.php’ handle() function.

Is there a better way to add this extra header without hardcoding the value?

hi there

you could create a Plugin to do this additional header, so you don’t have to manually apply the change after each Piwik upgrade.

what is your use case, maybe we should improve this in Piwik core in the CORS class? maybe create an issue on: Issues · matomo-org/piwik · GitHub