Access-Control-Allow-Origin header for error responses generated by MG_WEB

Skip to first unread message


Sep 2, 2021, 5:03:12 PM9/2/21
to Enterprise Web Developer Community
Is there a way to add additional headers for MG_WEB generated error responses (I.E. 500 errors due to DB connectivity problem)?  It would be helpful to be able to add the Access-Control-Allow-Origin header.  Otherwise these error responses won't display in modern browsers do to CORS errors - and I end up chasing a CORS problem until I look at the MG_WEB log and see it sent an error response.


Sep 2, 2021, 6:19:09 PM9/2/21



All we currently have is a way to override the mg_web generated errors with custom error forms – see section 4 in the doc (page 28).


We don’t have a mechanism for supplementing these custom forms with your own headers, unfortunately.  This would have to be an enhancement for the future.


Of course, error messages generated from M – including the response headers – are under your control anyway.





You received this message because you are subscribed to the Google Groups "Enterprise Web Developer Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web, visit


Sep 2, 2021, 6:53:55 PM9/2/21
to Enterprise Web Developer Community
Ok, thanks Chris, please consider it for a future enhancement.  The errors I generate are indeed under my control, and have the appropriate headers.  I was setting up a new system, and kept getting CORS errors.  It was driving me crazy since I KNEW I had fixed the CORS header issues a long time ago.  I finally looked at the MG_WEB log and saw it was unable to connect to the DB and had returned it's own error message without the headers, so then I could turn my attention to the real problem!

Reply all
Reply to author
0 new messages