Regarding Local file Scan is not working

15 views
Skip to first unread message

SUJEET BORAN

unread,
Jan 20, 2025, 9:08:05 AM1/20/25
to ZAP User Group
Hello, 
I am trying to work with ZAP on my personal project Following are the issue I am facing. 
i have 2 test case. When I pass URL it is passing. but when I download the content of URL and store that content in a file and pass that file it's failes. 
Following are the result for both case. 
Case1:- 
URL-> imported URL 44
Download file and pass local path -> Imported URL 43
copy manually json data and passing local path -> Imported URL 43

Case1:- 
URL-> imported URL 107
Download file and pass local path -> Imported URL 0
copy manually json data and passing local path -> Imported URL 0
First I thought problem is with my download code and formatting that's why I tried doing same thing manually but still i am getting same wrong result. 
following is my python code to download and do the stuff. 
I removed all the try except block just simple code. Kindly guide me that will be really helpful for my project. 
def download_file_data(presigned_url):
response = requests.get(presigned_url)
if response.ok:
json_content = response.json()
json_string = json.dumps(json_content)
file_path = os.path.join("/tmp", "swagger.json")
with open(file_path, "w") as file:
file.write(json_string)
return file_path

Simon Bennetts

unread,
Jan 22, 2025, 4:46:35 AM1/22/25
to ZAP User Group
Reply all
Reply to author
Forward
0 new messages