Switched JSON serialization to orjson for faster encoding and decoding.
CI / Formatting (push) Failing after 4s
CI / Linting (push) Successful in 4s
CI / Tests (Python 3.12) (push) Successful in 12s
CI / Tests (Python 3.13) (push) Successful in 12s
CI / Tests (Python 3.14) (push) Successful in 10s
CI / Type Checking (push) Successful in 9s
CI / Spelling (push) Successful in 5s
Audit / Dependencies (push) Successful in 7s
CI / Formatting (push) Failing after 4s
CI / Linting (push) Successful in 4s
CI / Tests (Python 3.12) (push) Successful in 12s
CI / Tests (Python 3.13) (push) Successful in 12s
CI / Tests (Python 3.14) (push) Successful in 10s
CI / Type Checking (push) Successful in 9s
CI / Spelling (push) Successful in 5s
Audit / Dependencies (push) Successful in 7s
This commit is contained in:
@@ -22,6 +22,7 @@ from collections.abc import Awaitable, Callable, Coroutine
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Any
|
||||
|
||||
import orjson
|
||||
from aiohttp import web
|
||||
|
||||
from . import __version__
|
||||
@@ -143,7 +144,7 @@ class HttpServer:
|
||||
async def _handle_webhook(self, request: web.Request) -> web.Response:
|
||||
"""Handle incoming webhook requests from Owncast."""
|
||||
try:
|
||||
data = await request.json()
|
||||
data = await request.json(loads=orjson.loads)
|
||||
except ValueError as e:
|
||||
# Invalid JSON received. This shouldn't happen
|
||||
# with legitimate Owncast webhooks.
|
||||
|
||||
Reference in New Issue
Block a user