mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-14 23:25:25 +03:00
Added starlette plugin to expose custom headers
This commit is contained in:
parent
8f8d8e1e4c
commit
fb804bac4e
@ -5,6 +5,7 @@ from fastapi import FastAPI, Request
|
||||
from fastapi.responses import JSONResponse
|
||||
from playhouse.sqliteq import SqliteQueueDatabase
|
||||
from starlette_context import middleware, plugins
|
||||
from starlette_context.plugins import Plugin
|
||||
|
||||
from frigate.api import app as main_app
|
||||
from frigate.api import auth, event, export, media, notification, preview, review
|
||||
@ -29,6 +30,11 @@ def check_csrf(request: Request):
|
||||
)
|
||||
|
||||
|
||||
# Used to retrieve the remote-user header: https://starlette-context.readthedocs.io/en/latest/plugins.html#easy-mode
|
||||
class RemoteUserPlugin(Plugin):
|
||||
key = "Remote-User"
|
||||
|
||||
|
||||
def create_fastapi_app(
|
||||
frigate_config,
|
||||
database: SqliteQueueDatabase,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user