Allow heading tags (h1-h6) in ContentSanitizer so news editor headings render
This commit is contained in:
12
services/enhance-worker/app/security.py
Normal file
12
services/enhance-worker/app/security.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from fastapi import HTTPException, Request, status
|
||||
|
||||
|
||||
def verify_bearer_token(request: Request) -> None:
|
||||
settings = request.app.state.settings
|
||||
authorization = request.headers.get("Authorization", "")
|
||||
scheme, _, token = authorization.partition(" ")
|
||||
|
||||
if scheme.lower() != "bearer" or token != settings.token:
|
||||
raise HTTPException(status_code=status.HTTP_401_UNAUTHORIZED, detail="Unauthorized")
|
||||
Reference in New Issue
Block a user