You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
One thing I’ve run into across ASGI services is how easy it is for HTTP security headers to diverge over time.
Different apps, slightly different middleware, small CSP changes that never get reconciled.
What’s been working better is treating headers as a policy that lives outside the app, and applying it once at the ASGI layer:
The benefit is less about Starlette itself and more about the ASGI boundary:
This has been especially useful in environments with multiple small services rather than one large app.
If useful, I put the pattern into a small library:
https://github.com/TypeError/secure
Interested if others are handling this at the ASGI layer or pushing it down into app logic.
Beta Was this translation helpful? Give feedback.
All reactions