Skip to content

Commit

Permalink
fix: remove 'parse error' from output in successful Cache-Control res…
Browse files Browse the repository at this point in the history
…ponse

Fixes #27
  • Loading branch information
sesh committed Feb 25, 2024
1 parent 36bf6dd commit 9d488ba
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion ready/checks/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,12 +252,13 @@ def check_html_should_not_be_cached_for_more_than_24_hours(responses, **kwargs):

if "max-age=" in cc_header:
max_age = re.search("max-age=(?P<age>\d+)", cc_header)

if max_age:
try:
age = int(max_age.group("age"))
return result(
age <= 86400,
f"Cache-Control max-age should be <= 86400 for HTML documents (parse error: {cc_header})",
f"Cache-Control max-age should be <= 86400 for HTML documents ({cc_header})",
"html_cache_duration",
**kwargs,
)
Expand Down
2 changes: 1 addition & 1 deletion ready/ready.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from importlib import resources
from . import checks as checks_module

VERSION = "1.2.3"
VERSION = "1.2.4"

from ready.checks.bad_response import (
check_bad_response_cloudflare,
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[metadata]
name = ready-check
version = 1.2.3
version = 1.2.4
author = Brenton Cleeland
author_email = [email protected]
description = A developer-friendly web scanning tool
Expand Down

0 comments on commit 9d488ba

Please sign in to comment.