boy-hack / hack-requests

The hack-requests is an http network library for hackers
MIT License
466 stars 90 forks source link

hackRequests.httpraw don't support location(redirects) #10

Closed ac0d3r closed 5 years ago

ac0d3r commented 5 years ago
In [1]: import HackRequests 
   ...:  
   ...: hack = HackRequests.hackRequests()                                                                                                                                         

In [2]: raw = ''' 
   ...: GET / HTTP/1.1 
   ...: Host: www.python.org 
   ...: Connection: Keep-Alive 
   ...: Cache-Control: max-age=0 
   ...: Upgrade-Insecure-Requests: 1 
   ...: User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/68.0.3440.106 Safari/537.36 
   ...: Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 
   ...: Accept-Encoding: gzip, deflate 
   ...: Accept-Language: zh-CN,zh;q=0.9,en;q=0.8 
   ...: '''                                                                                                                                                                        

In [3]: hh = hack.httpraw(raw)                                                                                                                                                     

In [4]: hh.status_code                                                                                                                                                             
Out[4]: 301

In [5]: hh.text()                                                                                                                                                                  
Out[5]: ''