diff --git a/CHANGES.txt b/CHANGES.txt index e5ce95b73fe..25853755a09 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -38,3 +38,5 @@ CHANGES - Enable passing pre-compressed data in requests #621 - Expose named routes via UrlDispatcher.named_routes() #622 + +- Allow disabling sendfile by environment variable AIOHTTP_NOSENDFILE #629 diff --git a/aiohttp/web_urldispatcher.py b/aiohttp/web_urldispatcher.py index 17ce659eb22..6627b82cd4f 100644 --- a/aiohttp/web_urldispatcher.py +++ b/aiohttp/web_urldispatcher.py @@ -163,7 +163,7 @@ def __init__(self, name, prefix, directory, *, raise ValueError( "No directory exists at '{}'".format(self._directory)) - if os.environ.get("AIOHTTP_NOSENDFILE") == "1": + if bool(os.environ.get("AIOHTTP_NOSENDFILE")): self._sendfile = self._sendfile_fallback def match(self, path):