Skip to content

Commit f15b984

Browse files
committed
clean up mimetypes
1 parent 255cbfd commit f15b984

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

zap/src/defectdojo_apiv2.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import mimetypes
23
import os
34

45
import requests
@@ -687,9 +688,8 @@ def upload_scan(self, engagement_id, scan_type, file, active, verified, close_ol
687688
if self.debug:
688689
print("filedata:")
689690
print(filedata)
690-
691-
if os.path.splitext(file)[-1].lower() == ".xml":
692-
filedata = ('report.xml',filedata,'text/xml')
691+
692+
filedata = ('report.xml', filedata, mimetypes.guess_file_type(file)[0])
693693

694694
data = {
695695
'file': filedata,

0 commit comments

Comments
 (0)