Skip to content

Commit 8375c44

Browse files
committed
[fix] Fixed uwsgi_curl
It was not possible to use uwsgi_curl for URLs, e.g.: http://127.0.0.1:8000/admin
1 parent fa5c539 commit 8375c44

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

images/common/utils.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,8 @@ def ask_uwsgi(uwsgi_addr, var, body='', timeout=0, udp=False):
117117
return b''.join(response).decode('utf8')
118118

119119

120-
def uwsgi_curl(
121-
uwsgi_addr, url='localhost', method='GET', body='', timeout=0, headers=(), udp=False
122-
):
123-
host, uri = get_host_from_url(url)
120+
def uwsgi_curl(uwsgi_addr, method='GET', body='', timeout=0, headers=(), udp=False):
121+
host, uri = get_host_from_url(uwsgi_addr)
124122
parts_uri = urlsplit(uri)
125123

126124
if '/' not in uwsgi_addr:
@@ -145,7 +143,6 @@ def uwsgi_curl(
145143
var['SERVER_NAME'] = var['HTTP_HOST']
146144
if port:
147145
var['SERVER_PORT'] = str(port)
148-
result = ask_uwsgi(
149-
uwsgi_addr=uwsgi_addr, var=var, body=body, timeout=timeout, udp=udp
150-
)
146+
147+
result = ask_uwsgi(uwsgi_addr=host, var=var, body=body, timeout=timeout, udp=udp)
151148
return result

0 commit comments

Comments
 (0)