]> git.madduck.net Git - etc/vim.git/blobdiff - src/blackd/middlewares.py

madduck's git repository

Every one of the projects in this repository is available at the canonical URL git://git.madduck.net/madduck/pub/<projectpath> — see each project's metadata for the exact URL.

All patches and comments are welcome. Please squash your changes to logical commits before using git-format-patch and git-send-email to patches@git.madduck.net. If you'd read over the Git project's submission guidelines and adhered to them, I'd be especially grateful.

SSH access, as well as push access can be individually arranged.

If you use my repositories frequently, consider adding the following snippet to ~/.gitconfig and using the third clone URL listed for each project:

[url "git://git.madduck.net/madduck/"]
  insteadOf = madduck:

Add preview flag to Vim plugin (#3246)
[etc/vim.git] / src / blackd / middlewares.py
index 97994ecc1dff81df44d81076534c9886e527bf1f..e71f5082686aff52dfe545f3a7f323b32a5b3416 100644 (file)
@@ -1,14 +1,15 @@
-from typing import Iterable, Awaitable, Callable
-from aiohttp.web_response import StreamResponse
-from aiohttp.web_request import Request
+from typing import Awaitable, Callable, Iterable
+
 from aiohttp.web_middlewares import middleware
 from aiohttp.web_middlewares import middleware
+from aiohttp.web_request import Request
+from aiohttp.web_response import StreamResponse
 
 Handler = Callable[[Request], Awaitable[StreamResponse]]
 Middleware = Callable[[Request, Handler], Awaitable[StreamResponse]]
 
 
 def cors(allow_headers: Iterable[str]) -> Middleware:
 
 Handler = Callable[[Request], Awaitable[StreamResponse]]
 Middleware = Callable[[Request, Handler], Awaitable[StreamResponse]]
 
 
 def cors(allow_headers: Iterable[str]) -> Middleware:
-    @middleware
+    @middleware  # type: ignore[misc]
     async def impl(request: Request, handler: Handler) -> StreamResponse:
         is_options = request.method == "OPTIONS"
         is_preflight = is_options and "Access-Control-Request-Method" in request.headers
     async def impl(request: Request, handler: Handler) -> StreamResponse:
         is_options = request.method == "OPTIONS"
         is_preflight = is_options and "Access-Control-Request-Method" in request.headers
@@ -31,4 +32,4 @@ def cors(allow_headers: Iterable[str]) -> Middleware:
 
         return resp
 
 
         return resp
 
-    return impl  # type: ignore
+    return impl  # type: ignore[no-any-return]