mirror of https://github.com/cowrie/cowrie.git
convert url to bytes for Twisted HTTPDownloader
This commit is contained in:
parent
8db9cc3672
commit
48e44a2c9d
|
@ -84,6 +84,7 @@ class command_curl(HoneyPotCommand):
|
|||
self.exit()
|
||||
return
|
||||
|
||||
url=bytes(url)
|
||||
self.url = url
|
||||
self.limit_size = 0
|
||||
cfg = self.protocol.cfg
|
||||
|
@ -366,7 +367,7 @@ class HTTPProgressDownloader(client.HTTPDownloader):
|
|||
"""
|
||||
"""
|
||||
client.HTTPDownloader.__init__(self, url, outfile, headers=headers,
|
||||
agent='curl/7.38.0')
|
||||
agent=b'curl/7.38.0')
|
||||
self.status = None
|
||||
self.curl = curl
|
||||
self.fakeoutfile = fakeoutfile
|
||||
|
|
|
@ -97,6 +97,7 @@ class command_wget(HoneyPotCommand):
|
|||
url = 'http://%s' % url
|
||||
|
||||
urldata = urlparse(url)
|
||||
url = bytes(url)
|
||||
|
||||
if outfile is None:
|
||||
outfile = urldata.path.split('/')[-1]
|
||||
|
@ -240,7 +241,7 @@ commands['/usr/bin/dget'] = command_wget
|
|||
class HTTPProgressDownloader(client.HTTPDownloader):
|
||||
def __init__(self, wget, fakeoutfile, url, outfile, headers=None):
|
||||
client.HTTPDownloader.__init__(self, url, outfile, headers=headers,
|
||||
agent='Wget/1.11.4')
|
||||
agent=b'Wget/1.11.4')
|
||||
self.status = None
|
||||
self.wget = wget
|
||||
self.fakeoutfile = fakeoutfile
|
||||
|
|
Loading…
Reference in New Issue