mirror of https://github.com/CIRCL/lookyloo
fix: Avoid exception when there are no cookies
parent
5603f88cbc
commit
1db6135e79
|
@ -462,7 +462,9 @@ class CaptureInfo(Resource): # type: ignore[misc]
|
||||||
params={'capture_uuid': 'The UUID of the capture'})
|
params={'capture_uuid': 'The UUID of the capture'})
|
||||||
class CaptureCookies(Resource): # type: ignore[misc]
|
class CaptureCookies(Resource): # type: ignore[misc]
|
||||||
def get(self, capture_uuid: str) -> dict[str, Any]:
|
def get(self, capture_uuid: str) -> dict[str, Any]:
|
||||||
return json.loads(lookyloo.get_cookies(capture_uuid).read())
|
if cookies := lookyloo.get_cookies(capture_uuid).read():
|
||||||
|
return json.loads(cookies)
|
||||||
|
return {}
|
||||||
|
|
||||||
|
|
||||||
@api.route('/json/<string:capture_uuid>/report')
|
@api.route('/json/<string:capture_uuid>/report')
|
||||||
|
|
Loading…
Reference in New Issue