Skip to content

Commit 51bfefe

Browse files
committed
Skip obvious HTML files in security.txt parsing
1 parent 81e290f commit 51bfefe

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

disclosure/sectxtparse.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ def parsesectxt(rawdata):
2424
sectxt = rawdata.decode("utf-8").strip().split("\n")
2525
except UnicodeDecodeError:
2626
return None
27+
if sectxt[0].lower().startswith(("<html", "<!doctype")):
28+
# Skip parsing if content looks like HTML file
29+
return None
2730
dat = {}
2831
for line in sectxt:
2932
if line.startswith("#") or line.strip() == "":

0 commit comments

Comments
 (0)