We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
option to disable automatic client response body decompression
enhancement for https://github.com/aio-libs/aiohttp/issues/1992

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `aiohttp/resolver.py`
Content:
```
1 import asyncio
2 import socket
3 from typing import Any, Dict, List, Optional
4 
5 from .abc import AbstractResolver
6 from .helpers import get_running_loop
7 
8 __all__ = ("ThreadedResolver", "AsyncResolver", "DefaultResolver")
9 
10 try:
11     import aiodns
12 
13     # aiodns_default = hasattr(aiodns.DNSResolver, 'gethostbyname')
14 except ImportError:  # pragma: no cover
15     aiodns = None
16 
17 aiodns_default = False
18 
19 
20 class ThreadedResolver(AbstractResolver):
21     """Use Executor for synchronous getaddrinfo() calls, which defaults to
22     concurrent.futures.ThreadPoolExecutor.
23     """
24 
25     def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None) -> None:
26         self._loop = get_running_loop(loop)
27 
28     async def resolve(
29         self, host: str, port: int = 0, family: int = socket.AF_INET
30     ) -> List[Dict[str, Any]]:
31         infos = await self._loop.getaddrinfo(
32             host, port, type=socket.SOCK_STREAM, family=family
33         )
34 
35         hosts = []
36         for family, _, proto, _, address in infos:
37             if family == socket.AF_INET6 and address[3]:  # type: ignore
38                 # This is essential for link-local IPv6 addresses.
39                 # LL IPv6 is a VERY rare case. Strictly speaking, we should use
40                 # getnameinfo() unconditionally, but performance makes sense.
41                 host, _port = socket.getnameinfo(
42                     address, socket.NI_NUMERICHOST | socket.NI_NUMERICSERV
43                 )
44                 port = int(_port)
45             else:
46                 host, port = address[:2]
47             hosts.append(
48                 {
49                     "hostname": host,
50                     "host": host,
51                     "port": port,
52                     "family": family,
53                     "proto": proto,
54                     "flags": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV,
55                 }
56             )
57 
58         return hosts
59 
60     async def close(self) -> None:
61         pass
62 
63 
64 class AsyncResolver(AbstractResolver):
65     """Use the `aiodns` package to make asynchronous DNS lookups"""
66 
67     def __init__(
68         self,
69         loop: Optional[asyncio.AbstractEventLoop] = None,
70         *args: Any,
71         **kwargs: Any
72     ) -> None:
73         if aiodns is None:
74             raise RuntimeError("Resolver requires aiodns library")
75 
76         self._loop = get_running_loop(loop)
77         self._resolver = aiodns.DNSResolver(*args, loop=loop, **kwargs)
78 
79         if not hasattr(self._resolver, "gethostbyname"):
80             # aiodns 1.1 is not available, fallback to DNSResolver.query
81             self.resolve = self._resolve_with_query  # type: ignore
82 
83     async def resolve(
84         self, host: str, port: int = 0, family: int = socket.AF_INET
85     ) -> List[Dict[str, Any]]:
86         try:
87             resp = await self._resolver.gethostbyname(host, family)
88         except aiodns.error.DNSError as exc:
89             msg = exc.args[1] if len(exc.args) >= 1 else "DNS lookup failed"
90             raise OSError(msg) from exc
91         hosts = []
92         for address in resp.addresses:
93             hosts.append(
94                 {
95                     "hostname": host,
96                     "host": address,
97                     "port": port,
98                     "family": family,
99                     "proto": 0,
100                     "flags": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV,
101                 }
102             )
103 
104         if not hosts:
105             raise OSError("DNS lookup failed")
106 
107         return hosts
108 
109     async def _resolve_with_query(
110         self, host: str, port: int = 0, family: int = socket.AF_INET
111     ) -> List[Dict[str, Any]]:
112         if family == socket.AF_INET6:
113             qtype = "AAAA"
114         else:
115             qtype = "A"
116 
117         try:
118             resp = await self._resolver.query(host, qtype)
119         except aiodns.error.DNSError as exc:
120             msg = exc.args[1] if len(exc.args) >= 1 else "DNS lookup failed"
121             raise OSError(msg) from exc
122 
123         hosts = []
124         for rr in resp:
125             hosts.append(
126                 {
127                     "hostname": host,
128                     "host": rr.host,
129                     "port": port,
130                     "family": family,
131                     "proto": 0,
132                     "flags": socket.AI_NUMERICHOST,
133                 }
134             )
135 
136         if not hosts:
137             raise OSError("DNS lookup failed")
138 
139         return hosts
140 
141     async def close(self) -> None:
142         return self._resolver.cancel()
143 
144 
145 DefaultResolver = AsyncResolver if aiodns_default else ThreadedResolver
146
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/aiohttp/resolver.py b/aiohttp/resolver.py
--- a/aiohttp/resolver.py
+++ b/aiohttp/resolver.py
@@ -26,10 +26,10 @@
         self._loop = get_running_loop(loop)
 
     async def resolve(
-        self, host: str, port: int = 0, family: int = socket.AF_INET
+        self, hostname: str, port: int = 0, family: int = socket.AF_INET
     ) -> List[Dict[str, Any]]:
         infos = await self._loop.getaddrinfo(
-            host, port, type=socket.SOCK_STREAM, family=family
+            hostname, port, type=socket.SOCK_STREAM, family=family
         )
 
         hosts = []
@@ -46,7 +46,7 @@
                 host, port = address[:2]
             hosts.append(
                 {
-                    "hostname": host,
+                    "hostname": hostname,
                     "host": host,
                     "port": port,
                     "family": family,

{"golden_diff": "diff --git a/aiohttp/resolver.py b/aiohttp/resolver.py\n--- a/aiohttp/resolver.py\n+++ b/aiohttp/resolver.py\n@@ -26,10 +26,10 @@\n         self._loop = get_running_loop(loop)\n \n     async def resolve(\n-        self, host: str, port: int = 0, family: int = socket.AF_INET\n+        self, hostname: str, port: int = 0, family: int = socket.AF_INET\n     ) -> List[Dict[str, Any]]:\n         infos = await self._loop.getaddrinfo(\n-            host, port, type=socket.SOCK_STREAM, family=family\n+            hostname, port, type=socket.SOCK_STREAM, family=family\n         )\n \n         hosts = []\n@@ -46,7 +46,7 @@\n                 host, port = address[:2]\n             hosts.append(\n                 {\n-                    \"hostname\": host,\n+                    \"hostname\": hostname,\n                     \"host\": host,\n                     \"port\": port,\n                     \"family\": family,\n", "issue": "option to disable automatic client response body decompression\nenhancement for https://github.com/aio-libs/aiohttp/issues/1992\n", "before_files": [{"content": "import asyncio\nimport socket\nfrom typing import Any, Dict, List, Optional\n\nfrom .abc import AbstractResolver\nfrom .helpers import get_running_loop\n\n__all__ = (\"ThreadedResolver\", \"AsyncResolver\", \"DefaultResolver\")\n\ntry:\n    import aiodns\n\n    # aiodns_default = hasattr(aiodns.DNSResolver, 'gethostbyname')\nexcept ImportError:  # pragma: no cover\n    aiodns = None\n\naiodns_default = False\n\n\nclass ThreadedResolver(AbstractResolver):\n    \"\"\"Use Executor for synchronous getaddrinfo() calls, which defaults to\n    concurrent.futures.ThreadPoolExecutor.\n    \"\"\"\n\n    def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None) -> None:\n        self._loop = get_running_loop(loop)\n\n    async def resolve(\n        self, host: str, port: int = 0, family: int = socket.AF_INET\n    ) -> List[Dict[str, Any]]:\n        infos = await self._loop.getaddrinfo(\n            host, port, type=socket.SOCK_STREAM, family=family\n        )\n\n        hosts = []\n        for family, _, proto, _, address in infos:\n            if family == socket.AF_INET6 and address[3]:  # type: ignore\n                # This is essential for link-local IPv6 addresses.\n                # LL IPv6 is a VERY rare case. Strictly speaking, we should use\n                # getnameinfo() unconditionally, but performance makes sense.\n                host, _port = socket.getnameinfo(\n                    address, socket.NI_NUMERICHOST | socket.NI_NUMERICSERV\n                )\n                port = int(_port)\n            else:\n                host, port = address[:2]\n            hosts.append(\n                {\n                    \"hostname\": host,\n                    \"host\": host,\n                    \"port\": port,\n                    \"family\": family,\n                    \"proto\": proto,\n                    \"flags\": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV,\n                }\n            )\n\n        return hosts\n\n    async def close(self) -> None:\n        pass\n\n\nclass AsyncResolver(AbstractResolver):\n    \"\"\"Use the `aiodns` package to make asynchronous DNS lookups\"\"\"\n\n    def __init__(\n        self,\n        loop: Optional[asyncio.AbstractEventLoop] = None,\n        *args: Any,\n        **kwargs: Any\n    ) -> None:\n        if aiodns is None:\n            raise RuntimeError(\"Resolver requires aiodns library\")\n\n        self._loop = get_running_loop(loop)\n        self._resolver = aiodns.DNSResolver(*args, loop=loop, **kwargs)\n\n        if not hasattr(self._resolver, \"gethostbyname\"):\n            # aiodns 1.1 is not available, fallback to DNSResolver.query\n            self.resolve = self._resolve_with_query  # type: ignore\n\n    async def resolve(\n        self, host: str, port: int = 0, family: int = socket.AF_INET\n    ) -> List[Dict[str, Any]]:\n        try:\n            resp = await self._resolver.gethostbyname(host, family)\n        except aiodns.error.DNSError as exc:\n            msg = exc.args[1] if len(exc.args) >= 1 else \"DNS lookup failed\"\n            raise OSError(msg) from exc\n        hosts = []\n        for address in resp.addresses:\n            hosts.append(\n                {\n                    \"hostname\": host,\n                    \"host\": address,\n                    \"port\": port,\n                    \"family\": family,\n                    \"proto\": 0,\n                    \"flags\": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV,\n                }\n            )\n\n        if not hosts:\n            raise OSError(\"DNS lookup failed\")\n\n        return hosts\n\n    async def _resolve_with_query(\n        self, host: str, port: int = 0, family: int = socket.AF_INET\n    ) -> List[Dict[str, Any]]:\n        if family == socket.AF_INET6:\n            qtype = \"AAAA\"\n        else:\n            qtype = \"A\"\n\n        try:\n            resp = await self._resolver.query(host, qtype)\n        except aiodns.error.DNSError as exc:\n            msg = exc.args[1] if len(exc.args) >= 1 else \"DNS lookup failed\"\n            raise OSError(msg) from exc\n\n        hosts = []\n        for rr in resp:\n            hosts.append(\n                {\n                    \"hostname\": host,\n                    \"host\": rr.host,\n                    \"port\": port,\n                    \"family\": family,\n                    \"proto\": 0,\n                    \"flags\": socket.AI_NUMERICHOST,\n                }\n            )\n\n        if not hosts:\n            raise OSError(\"DNS lookup failed\")\n\n        return hosts\n\n    async def close(self) -> None:\n        return self._resolver.cancel()\n\n\nDefaultResolver = AsyncResolver if aiodns_default else ThreadedResolver\n", "path": "aiohttp/resolver.py"}], "after_files": [{"content": "import asyncio\nimport socket\nfrom typing import Any, Dict, List, Optional\n\nfrom .abc import AbstractResolver\nfrom .helpers import get_running_loop\n\n__all__ = (\"ThreadedResolver\", \"AsyncResolver\", \"DefaultResolver\")\n\ntry:\n    import aiodns\n\n    # aiodns_default = hasattr(aiodns.DNSResolver, 'gethostbyname')\nexcept ImportError:  # pragma: no cover\n    aiodns = None\n\naiodns_default = False\n\n\nclass ThreadedResolver(AbstractResolver):\n    \"\"\"Use Executor for synchronous getaddrinfo() calls, which defaults to\n    concurrent.futures.ThreadPoolExecutor.\n    \"\"\"\n\n    def __init__(self, loop: Optional[asyncio.AbstractEventLoop] = None) -> None:\n        self._loop = get_running_loop(loop)\n\n    async def resolve(\n        self, hostname: str, port: int = 0, family: int = socket.AF_INET\n    ) -> List[Dict[str, Any]]:\n        infos = await self._loop.getaddrinfo(\n            hostname, port, type=socket.SOCK_STREAM, family=family\n        )\n\n        hosts = []\n        for family, _, proto, _, address in infos:\n            if family == socket.AF_INET6 and address[3]:  # type: ignore\n                # This is essential for link-local IPv6 addresses.\n                # LL IPv6 is a VERY rare case. Strictly speaking, we should use\n                # getnameinfo() unconditionally, but performance makes sense.\n                host, _port = socket.getnameinfo(\n                    address, socket.NI_NUMERICHOST | socket.NI_NUMERICSERV\n                )\n                port = int(_port)\n            else:\n                host, port = address[:2]\n            hosts.append(\n                {\n                    \"hostname\": hostname,\n                    \"host\": host,\n                    \"port\": port,\n                    \"family\": family,\n                    \"proto\": proto,\n                    \"flags\": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV,\n                }\n            )\n\n        return hosts\n\n    async def close(self) -> None:\n        pass\n\n\nclass AsyncResolver(AbstractResolver):\n    \"\"\"Use the `aiodns` package to make asynchronous DNS lookups\"\"\"\n\n    def __init__(\n        self,\n        loop: Optional[asyncio.AbstractEventLoop] = None,\n        *args: Any,\n        **kwargs: Any\n    ) -> None:\n        if aiodns is None:\n            raise RuntimeError(\"Resolver requires aiodns library\")\n\n        self._loop = get_running_loop(loop)\n        self._resolver = aiodns.DNSResolver(*args, loop=loop, **kwargs)\n\n        if not hasattr(self._resolver, \"gethostbyname\"):\n            # aiodns 1.1 is not available, fallback to DNSResolver.query\n            self.resolve = self._resolve_with_query  # type: ignore\n\n    async def resolve(\n        self, host: str, port: int = 0, family: int = socket.AF_INET\n    ) -> List[Dict[str, Any]]:\n        try:\n            resp = await self._resolver.gethostbyname(host, family)\n        except aiodns.error.DNSError as exc:\n            msg = exc.args[1] if len(exc.args) >= 1 else \"DNS lookup failed\"\n            raise OSError(msg) from exc\n        hosts = []\n        for address in resp.addresses:\n            hosts.append(\n                {\n                    \"hostname\": host,\n                    \"host\": address,\n                    \"port\": port,\n                    \"family\": family,\n                    \"proto\": 0,\n                    \"flags\": socket.AI_NUMERICHOST | socket.AI_NUMERICSERV,\n                }\n            )\n\n        if not hosts:\n            raise OSError(\"DNS lookup failed\")\n\n        return hosts\n\n    async def _resolve_with_query(\n        self, host: str, port: int = 0, family: int = socket.AF_INET\n    ) -> List[Dict[str, Any]]:\n        if family == socket.AF_INET6:\n            qtype = \"AAAA\"\n        else:\n            qtype = \"A\"\n\n        try:\n            resp = await self._resolver.query(host, qtype)\n        except aiodns.error.DNSError as exc:\n            msg = exc.args[1] if len(exc.args) >= 1 else \"DNS lookup failed\"\n            raise OSError(msg) from exc\n\n        hosts = []\n        for rr in resp:\n            hosts.append(\n                {\n                    \"hostname\": host,\n                    \"host\": rr.host,\n                    \"port\": port,\n                    \"family\": family,\n                    \"proto\": 0,\n                    \"flags\": socket.AI_NUMERICHOST,\n                }\n            )\n\n        if not hosts:\n            raise OSError(\"DNS lookup failed\")\n\n        return hosts\n\n    async def close(self) -> None:\n        return self._resolver.cancel()\n\n\nDefaultResolver = AsyncResolver if aiodns_default else ThreadedResolver\n", "path": "aiohttp/resolver.py"}]}