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
connection = context.switch_to_http_connection() # for http response only
228
+
if connection.headers['somekey']:
229
+
# response = context.get_response() -> use the `response` to add extra definitions to things you want to see on
230
+
return PlainTextResponse('Header is not allowed.')
231
+
await call_next()
232
+
```
233
+
Things to note:
234
+
235
+
- middleware functions must be `async`.
236
+
- middleware functions can return a `response` or modify a `response` returned
237
+
- middleware functions must call `call_next` and `await` its actions as shown above.
196
238
197
239
## **Injector Module**
198
240
`EllarInjector` is based on a python library [injector](https://injector.readthedocs.io/en/latest/index.html). Both share similar `Module` features with few distinct features.
0 commit comments