Content-Type always HTML when 404 error

I’m using ColdBox to build a Rest API and I’m having a strange issue with content-type returned in the responséis case of 404 error. The weird thing is that in my LOCAL environment all is working fine and the content-type is JSON even if a 404.htm is served by IIS. When I move the code in a development or live server with same IIS settings the content-type is HTML. I tried to explicitly use the event.setHTTPHeader(name=“Content-Type”, value=“json”) but it looks like is ignored or override at some point.

Any suggestion?



I finally solved this. It was just a setting in IIS that needed to always accept detailed custom error.