Make your NSF to a nice Microservice within minutes
I was fiddling around with SmartNSF and soon realized that I needed the CORS-header to make it somewhat easier to debug. In other words, setting the 'Access-Control-Allow-Origin' to '*' or 'true'. I suspect that I probably can use the event PRE_LOAD_DOCUMENT to do stuff like this, but I am not sure. Any tips?
I would do it during the PRE_SUBMIT event:
events PRE_SUBMIT:{
context, document -> def response = context.getResponse(); response.addHeader....
}
context.getResponse() returns a HttpServletResponse