Skip to content

Commit 219f469

Browse files
committed
Merge branch 'master' of github.com:ipfs/python-ipfs-api into filestream
2 parents 96856d8 + 495adf5 commit 219f469

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ipfsApi/http.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"""
55
from __future__ import absolute_import
66

7+
import re
78
import requests
89
import contextlib
910
import tarfile
@@ -29,7 +30,10 @@ class HTTPClient(object):
2930
def __init__(self, host, port, base, default_enc, **defaults):
3031
self.host = host
3132
self.port = port
32-
self.base = 'http://%s:%s/%s' % (host, port, base)
33+
if not re.match('^https?://', host.lower()):
34+
host = 'http://' + host
35+
36+
self.base = '%s:%s/%s' % (host, port, base)
3337

3438
# default request keyword-args
3539
if 'opts' in defaults:

0 commit comments

Comments
 (0)