Add already submitted check
This commit is contained in:
parent
b8e6f9f979
commit
bc10be69a0
@ -44,10 +44,12 @@ def _upload_to_wpasec(path, timeout=30):
|
|||||||
payload = {'file': file_to_upload}
|
payload = {'file': file_to_upload}
|
||||||
|
|
||||||
try:
|
try:
|
||||||
requests.post('https://wpa-sec.stanev.org/?submit',
|
result = requests.post('https://wpa-sec.stanev.org/?submit',
|
||||||
headers=headers,
|
headers=headers,
|
||||||
files=payload,
|
files=payload,
|
||||||
timeout=timeout)
|
timeout=timeout)
|
||||||
|
if ' already submitted' in result.text:
|
||||||
|
logging.warning(f"{path} was already submitted.")
|
||||||
except requests.exceptions.RequestException as e:
|
except requests.exceptions.RequestException as e:
|
||||||
logging.error(f"WPA_SEC: Got an exception while uploading {path} -> {e}")
|
logging.error(f"WPA_SEC: Got an exception while uploading {path} -> {e}")
|
||||||
raise e
|
raise e
|
||||||
|
Loading…
x
Reference in New Issue
Block a user