feat(http): fix X-Audit-Log-Reason

This commit is contained in:
grey-cat-1908 2022-05-28 12:27:48 +03:00
parent 702f7d3129
commit 801195e892

View file

@ -5,6 +5,7 @@ from __future__ import annotations
import asyncio
import logging
from urllib.parse import quote
from typing import Dict, Optional, Any
from aiohttp import ClientSession, ClientResponse
@ -85,6 +86,11 @@ class HTTPClient:
url = f"{self.url}/{endpoint}"
if headers is not None and headers.get("X-Audit-Log-Reason") is not None:
headers["X-Audit-Log-Reason"] = quote(
headers["X-Audit-Log-Reason"], safe="/ "
)
async with self.__aiohttp_session.request(
method,
url,