From b9f0e6800d4a61c9351aea693b8c51f41491ca8c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Tue, 8 Oct 2019 07:01:25 +0200 Subject: [PATCH 1/2] Fix return type of werkzeug's ProxyFix It returns `List[bytes]`, like all WSGI middlewares. --- third_party/2and3/werkzeug/middleware/proxy_fix.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/2and3/werkzeug/middleware/proxy_fix.pyi b/third_party/2and3/werkzeug/middleware/proxy_fix.pyi index 46aec1528360..3ebdab81815a 100644 --- a/third_party/2and3/werkzeug/middleware/proxy_fix.pyi +++ b/third_party/2and3/werkzeug/middleware/proxy_fix.pyi @@ -1,4 +1,4 @@ -from typing import Iterable, Optional +from typing import Iterable, Optional, List from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment class ProxyFix(object): @@ -20,4 +20,4 @@ class ProxyFix(object): x_prefix: int = ..., ) -> None: ... def get_remote_addr(self, forwarded_for: Iterable[str]) -> Optional[str]: ... - def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> WSGIApplication: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... From 0e27d370b94652fef2566aa9cf900be09295ba3e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Lalinsk=C3=BD?= Date: Tue, 8 Oct 2019 09:52:35 +0200 Subject: [PATCH 2/2] Return Iterable[bytes] instead of List[bytes] --- third_party/2and3/werkzeug/middleware/proxy_fix.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/third_party/2and3/werkzeug/middleware/proxy_fix.pyi b/third_party/2and3/werkzeug/middleware/proxy_fix.pyi index 3ebdab81815a..764fc6f077ac 100644 --- a/third_party/2and3/werkzeug/middleware/proxy_fix.pyi +++ b/third_party/2and3/werkzeug/middleware/proxy_fix.pyi @@ -1,4 +1,4 @@ -from typing import Iterable, Optional, List +from typing import Iterable, Optional from wsgiref.types import StartResponse, WSGIApplication, WSGIEnvironment class ProxyFix(object): @@ -20,4 +20,4 @@ class ProxyFix(object): x_prefix: int = ..., ) -> None: ... def get_remote_addr(self, forwarded_for: Iterable[str]) -> Optional[str]: ... - def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> List[bytes]: ... + def __call__(self, environ: WSGIEnvironment, start_response: StartResponse) -> Iterable[bytes]: ...