Closed CrowdHailer closed 5 years ago
@nietaki My suggestion is that this PR would be replaced with one to add these middleware as separate hex packages to Raxx.Kit.
See my comment in #118, I'm not sure Raxx.Kit is the best place for extracted middlewares, in the short or long term.
Done in other places
Implement a selection of middlewares.
This has been done all in one PR so that it can be coordinated with the final improvements to the middleware interface
CORS
There appear to be several "choices" when implementing a CORS middleware. Places where the existing tools (CORSPlug and Corsica) behave differently.
Should an Invalid CORS request be passed up the stack and no cors information added to the response
CORSPlug does not separate expose_headers from accept_headers, although I am now convinced that it should
Should the accept-headers response list all possible headers or only those requested
What to do if the configuration supports an any method paramenter, I don't see any value in this is there any wild implementation that needs to support a huge number of HTTP methods
Understanding CORS
Cross origin resource sharing
Flow chart 1 2