byt3bl33d3r / WitnessMe

Web Inventory tool, takes screenshots of webpages using Pyppeteer (headless Chrome/Chromium) and provides some extra bells & whistles to make life easier.
GNU General Public License v3.0
727 stars 109 forks source link

Issue downloading result via API #18

Closed starskizzle closed 3 years ago

starskizzle commented 4 years ago

After cloning the source and using the dockerfile.api to create a container, I received a 500 error trying to download the result using the API (tested using the built in swagger ui). I believe line 59 in scan.py needs to be changed...

WitnessMe/witnessme/api/routers/scan.py

@router.get("/{scan_id}/result")
async def get_scan_result(scan_id: uuid.UUID, request: Request):
    scan = request.app.state.SCANS.get(scan_id)
#    if not scan.stats.done:
#change to something like
      if not scan.state in [ScanState.DONE]:

After which I received an error that aiotools needed to be installed. Adding this to requirements.txt resolved this issue.

aiofiles==0.5.0 --hash=sha256:377fdf7815cc611870c59cbd07b68b180841d2a2b79812d8c218be02448c2acb

After which everything worked like a charm. Thanks for the app!

byt3bl33d3r commented 4 years ago

ahh , thanks for that. Good catch. I'll add that to the deps. Cheers