#1191 Added possibility to pass custom headers to URLInputFile object (#1197)

This commit is contained in:
Alex Root Junior 2023-06-25 01:39:26 +03:00 committed by GitHub
parent 484a61bdc1
commit d29b18da8c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 53 additions and 16 deletions

View file

@ -1,5 +1,5 @@
from collections import deque
from typing import TYPE_CHECKING, AsyncGenerator, Deque, Optional, Type
from typing import TYPE_CHECKING, Any, AsyncGenerator, Deque, Dict, Optional, Type
from aiogram import Bot
from aiogram.client.session.base import BaseSession
@ -42,9 +42,10 @@ class MockedSession(BaseSession):
async def stream_content(
self,
url: str,
timeout: int,
chunk_size: int,
raise_for_status: bool,
headers: Optional[Dict[str, Any]] = None,
timeout: int = 30,
chunk_size: int = 65536,
raise_for_status: bool = True,
) -> AsyncGenerator[bytes, None]: # pragma: no cover
yield b""