From 6763bb1070f8aff4667a5d38cfe849788e62e32c Mon Sep 17 00:00:00 2001 From: Arthur A Date: Tue, 28 Jun 2022 09:47:15 -0300 Subject: [PATCH] fix: -rh "" Python Error: ``` [+] Sending token Traceback (most recent call last): File "/jwt_tool/jwt_tool.py", line 2034, in rejigToken(headDict, paylDict, sig) File "/jwt_tool/jwt_tool.py", line 1330, in rejigToken jwtOut(newContents+"."+sig, "Sending token") File "/jwt_tool/jwt_tool.py", line 232, in jwtOut resData = sendToken(token, cookiedict, logID, headertoken[0], posttoken[0]) File "/jwt_tool/jwt_tool.py", line 144, in sendToken headerName, headerVal = eachHeader.split(":",1) ValueError: not enough values to unpack (expected 2, got 1) ``` When -rh is equal to "" the script tries to do a split and ends up giving an error. I added a condition to check this. --- jwt_tool.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/jwt_tool.py b/jwt_tool.py index 23e9c14..ab01c8c 100644 --- a/jwt_tool.py +++ b/jwt_tool.py @@ -141,8 +141,9 @@ def sendToken(token, cookiedict, track, headertoken="", postdata=None): headers = {'User-agent': config['customising']['useragent']+" "+track} if headertoken: for eachHeader in headertoken: - headerName, headerVal = eachHeader.split(":",1) - headers[headerName] = headerVal.lstrip(" ") + if eachHeader.replace(' ','') != "": + headerName, headerVal = eachHeader.split(":",1) + headers[headerName] = headerVal.lstrip(" ") try: if config['services']['proxy'] == "False": if postdata: