<p dir="auto">Commit <a class="commit-link" data-hovercard-type="commit" data-hovercard-url="https://github.com/psf/requests/commit/b149be5d864cc7f65ac22113db3d0e4d2ed2b49e/hovercard" href="https://github.com/psf/requests/commit/b149be5d864cc7f65ac22113db3d0e4d2ed2b49e"><tt>b149be5</tt></a> specifically removed all processing of non-HTTP(s) URLs.  Previous to this commit if you were to pass in params, it would be appended to the URL.  Since this commit it no longer works.  Specifically I ran into this issue when running docker-py against a unix socket.</p>
<p dir="auto">I understand that for non standard URLs you don't want to parse them.  It seems that if the params were passed, then you should still append them.  I'll gladly put in a pull request for this if it seems like a valid issue.  A simple fix would be the below</p>
<div class="highlight highlight-source-python notranslate position-relative overflow-auto" dir="auto" data-snippet-clipboard-copy-content="        # Don't do any URL preparation for oddball schemes
        if ':' in url and not url.lower().startswith('http'):
            encoded_params = self._encode_params(params)
            if len(encoded_params) &gt; 0:
                if url.find('?') == -1:
                    url = '%s?%s' % (url, encoded_params)
                else:
                    url = '%s&amp;%s' % (url, encoded_params)
            self.url = url
            return
"><pre class="notranslate">        <span class="pl-c"># Don't do any URL preparation for oddball schemes</span>
        <span class="pl-k">if</span> <span class="pl-s">':'</span> <span class="pl-c1">in</span> <span class="pl-s1">url</span> <span class="pl-c1">and</span> <span class="pl-c1">not</span> <span class="pl-s1">url</span>.<span class="pl-en">lower</span>().<span class="pl-en">startswith</span>(<span class="pl-s">'http'</span>):
            <span class="pl-s1">encoded_params</span> <span class="pl-c1">=</span> <span class="pl-s1">self</span>.<span class="pl-en">_encode_params</span>(<span class="pl-s1">params</span>)
            <span class="pl-k">if</span> <span class="pl-en">len</span>(<span class="pl-s1">encoded_params</span>) <span class="pl-c1">&gt;</span> <span class="pl-c1">0</span>:
                <span class="pl-k">if</span> <span class="pl-s1">url</span>.<span class="pl-en">find</span>(<span class="pl-s">'?'</span>) <span class="pl-c1">==</span> <span class="pl-c1">-</span><span class="pl-c1">1</span>:
                    <span class="pl-s1">url</span> <span class="pl-c1">=</span> <span class="pl-s">'%s?%s'</span> <span class="pl-c1">%</span> (<span class="pl-s1">url</span>, <span class="pl-s1">encoded_params</span>)
                <span class="pl-k">else</span>:
                    <span class="pl-s1">url</span> <span class="pl-c1">=</span> <span class="pl-s">'%s&amp;%s'</span> <span class="pl-c1">%</span> (<span class="pl-s1">url</span>, <span class="pl-s1">encoded_params</span>)
            <span class="pl-s1">self</span>.<span class="pl-s1">url</span> <span class="pl-c1">=</span> <span class="pl-s1">url</span>
            <span class="pl-k">return</span></pre></div>
<p dir="auto">resquests.Session() adds extra Host field to the header dictionary passed as argument even if that field is already specified in the dictionary. This happens when transfer-encoding is specified in the header dictionary. Having duplicate host field in the header confuses apache traffic server.</p>