File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1515 RedirectResponse ,
1616 JSONResponse ,
1717)
18+ from starlette .requests import Request
19+ from starlette .responses import Response
20+ from typing import Callable , Awaitable , List , Optional
1821import shutil
1922import os
2023import json
3033from pygments .lexers import get_lexer_by_name , guess_lexer
3134from pygments .formatters import HtmlFormatter
3235from pygments .util import ClassNotFound
33- from typing import List , Optional
3436from . import __version__ , __author__ , __contact__ , __url__
35- from .schema import PasteCreate , PasteDetails , PasteResponse
37+ from .schema import PasteCreate , PasteResponse , PasteDetails
3638
3739description : str = "paste.py 🐍 - A pastebin written in python."
3840
5153 redoc_url = None ,
5254)
5355app .state .limiter = limiter
54- app .add_exception_handler (RateLimitExceeded , _rate_limit_exceeded_handler )
56+
57+ async def rate_limit_exceeded_handler (request : Request , exc : RateLimitExceeded ) -> Response :
58+ return await _rate_limit_exceeded_handler (request , exc )
59+
60+ app .add_exception_handler (RateLimitExceeded , rate_limit_exceeded_handler )
5561
5662origins : List [str ] = ["*" ]
5763
You can’t perform that action at this time.
0 commit comments