redbot 2.4.1__tar.gz → 2.4.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {redbot-2.4.1/redbot.egg-info → redbot-2.4.2}/PKG-INFO +1 -1
- {redbot-2.4.1 → redbot-2.4.2}/redbot/__init__.py +1 -1
- {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/__init__.py +1 -1
- {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/link_parse.py +6 -0
- {redbot-2.4.1 → redbot-2.4.2/redbot.egg-info}/PKG-INFO +1 -1
- {redbot-2.4.1 → redbot-2.4.2}/LICENSE.md +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/MANIFEST.in +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/README.md +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/pyproject.toml +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/__init__.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/__init__.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/check-circle.svg +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/exclamation-circle.svg +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/info-circle.svg +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/question-circle.svg +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/times-circle.svg +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/__init__.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/apple-touch-icon-144x144.png +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/apple-touch-icon-152x152.png +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/favicon-16x16.png +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/favicon-32x32.png +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/favicon.ico +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/mstile-144x144.png +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/redbot-sq.png +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/prettify.js +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/prettify.js.map +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/red_style.css +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/red_style.css.map +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/script.js +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/script.js.map +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/style.css +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/cli.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/daemon.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/__init__.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/har.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/html.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/html_base.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/null_links.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/__init__.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/footer.html +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/response_finish.html +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/response_multi_finish.html +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/response_start.html +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/text.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/i18n.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/note.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/__init__.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/base.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/conneg.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/etag_validate.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/lm_validate.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/range.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/fetch.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/__init__.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/es/LC_MESSAGES/messages.mo +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/es/LC_MESSAGES/messages.po +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/extra_strings.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/fr/LC_MESSAGES/messages.mo +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/fr/LC_MESSAGES/messages.po +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/ja/LC_MESSAGES/messages.mo +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/ja/LC_MESSAGES/messages.po +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/messages.pot +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/zh/LC_MESSAGES/messages.mo +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/zh/LC_MESSAGES/messages.po +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/type.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/utils.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/__init__.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/captcha.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/__init__.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/base.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/client_error.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/error.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/run_test.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/save.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/show.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/links.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/ratelimit.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/saved_tests.py +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/SOURCES.txt +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/dependency_links.txt +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/entry_points.txt +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/requires.txt +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/top_level.txt +0 -0
- {redbot-2.4.1 → redbot-2.4.2}/setup.cfg +0 -0
|
@@ -56,7 +56,7 @@ class HttpResource(RedFetcher):
|
|
|
56
56
|
self.linked: List[Tuple[HttpResource, str]] = [] # linked HttpResources
|
|
57
57
|
self._link_parser = link_parse.HTMLLinkParser(self.response, [self.process_link])
|
|
58
58
|
if self.descend or config.getboolean("content_links", False):
|
|
59
|
-
self.
|
|
59
|
+
self.response.decoded.processors.append(self._link_parser.feed_bytes)
|
|
60
60
|
|
|
61
61
|
def run_active_checks(self) -> None:
|
|
62
62
|
"""
|
|
@@ -13,6 +13,7 @@ from httplint.message import HttpMessageLinter
|
|
|
13
13
|
from httplint.syntax import rfc9110
|
|
14
14
|
|
|
15
15
|
DEFAULT_ENCODING = "utf-8"
|
|
16
|
+
MAX_FEED_BYTES = 2 * 1024 * 1024
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
class HTMLLinkParser(HTMLParser):
|
|
@@ -57,6 +58,7 @@ class HTMLLinkParser(HTMLParser):
|
|
|
57
58
|
self.errors = 0
|
|
58
59
|
self.last_err_pos: int = 0
|
|
59
60
|
self.ok = True
|
|
61
|
+
self.bytes_fed = 0
|
|
60
62
|
HTMLParser.__init__(self)
|
|
61
63
|
|
|
62
64
|
def __getstate__(self) -> Dict[str, Any]:
|
|
@@ -65,6 +67,10 @@ class HTMLLinkParser(HTMLParser):
|
|
|
65
67
|
def feed_bytes(self, bchunk: bytes) -> None:
|
|
66
68
|
"Feed a given chunk of bytes to the parser"
|
|
67
69
|
if self.ok:
|
|
70
|
+
self.bytes_fed += len(bchunk)
|
|
71
|
+
if self.bytes_fed > MAX_FEED_BYTES:
|
|
72
|
+
self.ok = False
|
|
73
|
+
return
|
|
68
74
|
encoding = self.message.character_encoding or DEFAULT_ENCODING
|
|
69
75
|
decoded = bchunk.decode(encoding, "ignore")
|
|
70
76
|
self.feed(decoded)
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|