From 326c99a58b56ddb7f1650e30e783878d10369b7a Mon Sep 17 00:00:00 2001 From: Sasha Romijn Date: Tue, 18 Jun 2024 17:14:32 +0200 Subject: [PATCH] Fix #1410 - Include sectxt notifications --- checks/tasks/securitytxt.py | 2 +- checks/test/test_securitytxt.py | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/checks/tasks/securitytxt.py b/checks/tasks/securitytxt.py index 9014dda6f..9da4c9622 100644 --- a/checks/tasks/securitytxt.py +++ b/checks/tasks/securitytxt.py @@ -143,5 +143,5 @@ def parser_format(parser_messages): "securitytxt_score": score, "securitytxt_found_host": result.found_host, "securitytxt_errors": errors, - "securitytxt_recommendations": parser_format(parser.recommendations), + "securitytxt_recommendations": parser_format(parser.recommendations + parser.notifications), } diff --git a/checks/test/test_securitytxt.py b/checks/test/test_securitytxt.py index afcd4431b..3870a84ef 100644 --- a/checks/test/test_securitytxt.py +++ b/checks/test/test_securitytxt.py @@ -213,6 +213,7 @@ def test_evaluate_securitytxt(): b"Expires: 2050-09-01T00:00:00.000Z\n" b"Contact: mailto:security@example.com\n" b"Canonical: https://host/.well-known/security.txt\n" + b"unknown-field: https://host/.well-known/security.txt\n" ), url="https://example.com/security.txt", found_host="host", @@ -228,5 +229,6 @@ def test_evaluate_securitytxt(): {"msgid": "long_expiry", "context": {"line_no": 1}}, {"msgid": "no_encryption", "context": {"line_no": None}}, {"msgid": "not_signed", "context": {"line_no": None}}, + {"msgid": "unknown_field", "context": {"line_no": None}}, ], }