fix/token header
This commit is contained in:
parent
d56251ceb9
commit
60fd0dc092
1 changed files with 4 additions and 3 deletions
|
@ -75,17 +75,18 @@ async def outbox(
|
||||||
db_session: AsyncSession = Depends(get_db_session),
|
db_session: AsyncSession = Depends(get_db_session),
|
||||||
) -> Response:
|
) -> Response:
|
||||||
payload = await request.body()
|
payload = await request.body()
|
||||||
logger.info(payload)
|
content = payload.decode("utf-8")
|
||||||
|
logger.info(content)
|
||||||
|
post_token = request.headers.get("Authorization")
|
||||||
|
|
||||||
if POST_TOKEN is not None \
|
if POST_TOKEN is not None \
|
||||||
and POST_TOKEN == request.headers.get("post_token"):
|
and POST_TOKEN == post_token.split(" ")[1]: # type: ignore
|
||||||
logger.info("True token")
|
logger.info("True token")
|
||||||
|
|
||||||
from app.activitypub import VisibilityEnum
|
from app.activitypub import VisibilityEnum
|
||||||
from app.boxes import _send_create
|
from app.boxes import _send_create
|
||||||
from app.orgpython import to_html
|
from app.orgpython import to_html
|
||||||
|
|
||||||
content = payload.decode("utf-8")
|
|
||||||
content = to_html(content).replace("\n", "")
|
content = to_html(content).replace("\n", "")
|
||||||
|
|
||||||
await _send_create(
|
await _send_create(
|
||||||
|
|
Loading…
Reference in a new issue