Skip to content

Commit

Permalink
Fixed cookie issue
Browse files Browse the repository at this point in the history
  • Loading branch information
evict committed Jun 16, 2017
1 parent 2e17702 commit cb3cc46
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions lib/TunnaClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,11 +250,14 @@ def HTTPreq(self,url,data=None,headers=None):
kargs['url']=url
if data: kargs['data']=data #Will do a GET if no data else POST
if headers: kargs['headers']=headers
else: kargs['headers']={'Content-Type':'application/octet-stream','Cookie':self.cookie}
else: kargs['headers']={'Content-Type':'application/octet-stream'}

if self.options['cookie']:
kargs['headers'].update({'Cookie':self.cookie})

if self.options['bauth']:
kargs['headers'].update({'Authorization': "Basic %s" % self.bauth})

#Make Request
f=opener.open(urllib2.Request(**kargs))

Expand Down
2 changes: 1 addition & 1 deletion proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def main():
advancedGroup.add_option('-q','--ping-interval', help='webshprx pinging thread interval (default = 0.5)', dest='ping_delay', action='store', type='float', default=Defaults['ping_delay'])
advancedGroup.add_option('-s','--start-ping', help='Start the pinging thread first - some services send data first (eg. SSH)', dest='start_p_thread', action='store_true', default=Defaults['start_p_thread'])
advancedGroup.add_option('-c','--verify-server-cert', help='Verify Server Certificate', dest='start_p_thread', action='store_false', default=Defaults['ignoreServerCert'])
advancedGroup.add_option('-C','--cookie', help='Request cookies', dest='cookie', action='store', default=Defaults['Cookie'])
advancedGroup.add_option('-C','--cookie', help='Request cookies', dest='cookie', action='store')
advancedGroup.add_option('-t','--authentication', help='Basic authentication', dest='bauth', action='store_true')

parser.add_option_group(advancedGroup)
Expand Down
Binary file removed settings.pyc
Binary file not shown.

0 comments on commit cb3cc46

Please sign in to comment.