mirror of https://github.com/n1nj4sec/pupy.git
Fix tinyhttp opener order
This commit is contained in:
parent
fcb8c51155
commit
1a34915635
|
@ -8,6 +8,7 @@ import urlparse
|
|||
import httplib
|
||||
import ssl
|
||||
import socket
|
||||
import types
|
||||
|
||||
import StringIO
|
||||
|
||||
|
@ -304,7 +305,11 @@ class HTTP(object):
|
|||
|
||||
handlers.append(UDPReaderHandler)
|
||||
|
||||
self.opener = urllib2.build_opener(*handlers)
|
||||
self.opener = urllib2.OpenerDirector()
|
||||
for h in handlers:
|
||||
if isinstance(h, (types.ClassType, type)):
|
||||
h = h()
|
||||
self.opener.add_handler(h)
|
||||
|
||||
if type(headers) == dict:
|
||||
self.opener.addheaders = [
|
||||
|
|
Loading…
Reference in New Issue