Skip to content

Commit

Permalink
client.py: check if bard_url ends with a / before constructing full url
Browse files Browse the repository at this point in the history
  • Loading branch information
Deep Ganguli committed Dec 6, 2013
1 parent 27e87cd commit b660ba7
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pydruid/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ def __init__(self,url,endpoint):
def post(self,query):
try:
querystr = json.dumps(query)
url = self.url + '/' + self.endpoint
if self.url.endswith('/'):
url = self.url + self.endpoint
else:
url = self.url + '/' + self.endpoint
headers = {'Content-Type' : 'application/json'}
req = urllib2.Request(url, querystr, headers)
res = urllib2.urlopen(req)
Expand Down

0 comments on commit b660ba7

Please sign in to comment.