Skip to content

Commit

Permalink
Merge pull request #389 from wiggin15/issue-387
Browse files Browse the repository at this point in the history
Fix #387: fix deluge JSON queries
  • Loading branch information
styxit committed Aug 21, 2017
2 parents 2c79778 + 9cc88d9 commit 4906974
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion modules/deluge.py
Expand Up @@ -132,7 +132,8 @@ def read_data(self,data):
url = 'http' + ssl + '://' + host + ':' + str(port) + deluge_basepath + '/json'

post_data = dumps(data)
buf = StringIO( self.opener.open(url, post_data,1).read())
req = urllib2.Request(url, data=post_data, headers={'Content-Type': 'application/json'})
buf = StringIO(self.opener.open(req, timeout=1).read())
f = gzip.GzipFile(fileobj=buf)
response = loads(f.read())
self.logger.debug ("response for %s is %s" %(data,response))
Expand Down

0 comments on commit 4906974

Please sign in to comment.