manosbatsis / restdude

Full stack, high level framework for horizontal, model-driven application hackers.
https://manosbatsis.github.io/restdude
3 stars 3 forks source link

Support dynamic CORS headers #20

Open manosbatsis opened 7 years ago

manosbatsis commented 7 years ago

To allow different CORS settings (like allowed origins) per entity model record:

  1. Add default CORS settings in base model service impl
  2. Add default controller OPTIONS handler method to set CORS headers based on service
  3. Add automatic handling in service method for models implementing e.g. a CorsAllowedOriginsProvidingModel interface
  4. Allow overriding CORS settings service method for entirely custom implementations