Skip to content
This repository was archived by the owner on Mar 22, 2021. It is now read-only.

Commit e9a0e6a

Browse files
committed
修正使用非 GET,HEAD 请求时碰到 302 时,请求方法保持不变的 Bug
1 parent b9d6906 commit e9a0e6a

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

hackhttp/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
"""
7777

7878
__title__ = 'hackhttp'
79-
__version__ = '1.0.0'
79+
__version__ = '1.0.2'
8080
__build__ = 0x020700
8181
__author__ = 'BugScanTeam'
8282
__author_email__ = '[email protected]'

hackhttp/hackhttp.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,7 @@ def _http(
426426
rep.version * 0.1, rep.status,
427427
rep.reason) + '\r\n' + str(retheader) + '\r\n' + (body[:4096])
428428
if location and url != redirect and locationcount < 5:
429+
method = 'HEAD' if method == 'HEAD' else 'GET'
429430
a, b, c, d, e = self._http(
430431
redirect, method=method, proxy=proxy,
431432
cookcookie=cookcookie, location=location,

0 commit comments

Comments
 (0)