Kaydet (Commit) 15ac73a2 authored tarafından Joffrey F's avatar Joffrey F Kaydeden (comit) GitHub

Merge pull request #1087 from docker/1076-dns-fix

Remove default adapters when connecting through a unix socket.
...@@ -60,6 +60,7 @@ class Client( ...@@ -60,6 +60,7 @@ class Client(
if base_url.startswith('http+unix://'): if base_url.startswith('http+unix://'):
self._custom_adapter = UnixAdapter(base_url, timeout) self._custom_adapter = UnixAdapter(base_url, timeout)
self.mount('http+docker://', self._custom_adapter) self.mount('http+docker://', self._custom_adapter)
self._unmount('http://', 'https://')
self.base_url = 'http+docker://localunixsocket' self.base_url = 'http+docker://localunixsocket'
elif base_url.startswith('npipe://'): elif base_url.startswith('npipe://'):
if not constants.IS_WINDOWS_PLATFORM: if not constants.IS_WINDOWS_PLATFORM:
...@@ -368,6 +369,10 @@ class Client( ...@@ -368,6 +369,10 @@ class Client(
[x for x in self._multiplexed_buffer_helper(res)] [x for x in self._multiplexed_buffer_helper(res)]
) )
def _unmount(self, *args):
for proto in args:
self.adapters.pop(proto)
def get_adapter(self, url): def get_adapter(self, url):
try: try:
return super(Client, self).get_adapter(url) return super(Client, self).get_adapter(url)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment