felixblaschke / shelf_plus

MIT License
73 stars 14 forks source link

Fix CORS example #36

Closed kliuchev closed 8 months ago

kliuchev commented 8 months ago

Remove corsHeader() from router Add corsHeader() to Pipeline()

Previous example didn't handle OPTIONS requests that are a part of CORS implementation

shelf_plus Router can't add middleware to non-specified routes ( by design ), so the best implementation is adding Pipeline with middleware "before" shelf_plus router.

felixblaschke commented 8 months ago

Good find! I updated the documentation accordingly 👍