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.
Files changed (84) hide show
  1. {redbot-2.4.1/redbot.egg-info → redbot-2.4.2}/PKG-INFO +1 -1
  2. {redbot-2.4.1 → redbot-2.4.2}/redbot/__init__.py +1 -1
  3. {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/__init__.py +1 -1
  4. {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/link_parse.py +6 -0
  5. {redbot-2.4.1 → redbot-2.4.2/redbot.egg-info}/PKG-INFO +1 -1
  6. {redbot-2.4.1 → redbot-2.4.2}/LICENSE.md +0 -0
  7. {redbot-2.4.1 → redbot-2.4.2}/MANIFEST.in +0 -0
  8. {redbot-2.4.1 → redbot-2.4.2}/README.md +0 -0
  9. {redbot-2.4.1 → redbot-2.4.2}/pyproject.toml +0 -0
  10. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/__init__.py +0 -0
  11. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/__init__.py +0 -0
  12. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/check-circle.svg +0 -0
  13. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/exclamation-circle.svg +0 -0
  14. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/info-circle.svg +0 -0
  15. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/question-circle.svg +0 -0
  16. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/icons/times-circle.svg +0 -0
  17. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/__init__.py +0 -0
  18. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/apple-touch-icon-144x144.png +0 -0
  19. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/apple-touch-icon-152x152.png +0 -0
  20. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/favicon-16x16.png +0 -0
  21. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/favicon-32x32.png +0 -0
  22. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/favicon.ico +0 -0
  23. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/mstile-144x144.png +0 -0
  24. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/logo/redbot-sq.png +0 -0
  25. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/prettify.js +0 -0
  26. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/prettify.js.map +0 -0
  27. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/red_style.css +0 -0
  28. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/red_style.css.map +0 -0
  29. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/script.js +0 -0
  30. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/script.js.map +0 -0
  31. {redbot-2.4.1 → redbot-2.4.2}/redbot/assets/style.css +0 -0
  32. {redbot-2.4.1 → redbot-2.4.2}/redbot/cli.py +0 -0
  33. {redbot-2.4.1 → redbot-2.4.2}/redbot/daemon.py +0 -0
  34. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/__init__.py +0 -0
  35. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/har.py +0 -0
  36. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/html.py +0 -0
  37. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/html_base.py +0 -0
  38. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/null_links.py +0 -0
  39. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/__init__.py +0 -0
  40. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/footer.html +0 -0
  41. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/response_finish.html +0 -0
  42. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/response_multi_finish.html +0 -0
  43. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/templates/response_start.html +0 -0
  44. {redbot-2.4.1 → redbot-2.4.2}/redbot/formatter/text.py +0 -0
  45. {redbot-2.4.1 → redbot-2.4.2}/redbot/i18n.py +0 -0
  46. {redbot-2.4.1 → redbot-2.4.2}/redbot/note.py +0 -0
  47. {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/__init__.py +0 -0
  48. {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/base.py +0 -0
  49. {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/conneg.py +0 -0
  50. {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/etag_validate.py +0 -0
  51. {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/lm_validate.py +0 -0
  52. {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/active_check/range.py +0 -0
  53. {redbot-2.4.1 → redbot-2.4.2}/redbot/resource/fetch.py +0 -0
  54. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/__init__.py +0 -0
  55. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/es/LC_MESSAGES/messages.mo +0 -0
  56. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/es/LC_MESSAGES/messages.po +0 -0
  57. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/extra_strings.py +0 -0
  58. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/fr/LC_MESSAGES/messages.mo +0 -0
  59. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/fr/LC_MESSAGES/messages.po +0 -0
  60. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/ja/LC_MESSAGES/messages.mo +0 -0
  61. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/ja/LC_MESSAGES/messages.po +0 -0
  62. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/messages.pot +0 -0
  63. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/zh/LC_MESSAGES/messages.mo +0 -0
  64. {redbot-2.4.1 → redbot-2.4.2}/redbot/translations/zh/LC_MESSAGES/messages.po +0 -0
  65. {redbot-2.4.1 → redbot-2.4.2}/redbot/type.py +0 -0
  66. {redbot-2.4.1 → redbot-2.4.2}/redbot/utils.py +0 -0
  67. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/__init__.py +0 -0
  68. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/captcha.py +0 -0
  69. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/__init__.py +0 -0
  70. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/base.py +0 -0
  71. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/client_error.py +0 -0
  72. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/error.py +0 -0
  73. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/run_test.py +0 -0
  74. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/save.py +0 -0
  75. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/handlers/show.py +0 -0
  76. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/links.py +0 -0
  77. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/ratelimit.py +0 -0
  78. {redbot-2.4.1 → redbot-2.4.2}/redbot/webui/saved_tests.py +0 -0
  79. {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/SOURCES.txt +0 -0
  80. {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/dependency_links.txt +0 -0
  81. {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/entry_points.txt +0 -0
  82. {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/requires.txt +0 -0
  83. {redbot-2.4.1 → redbot-2.4.2}/redbot.egg-info/top_level.txt +0 -0
  84. {redbot-2.4.1 → redbot-2.4.2}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: redbot
3
- Version: 2.4.1
3
+ Version: 2.4.2
4
4
  Summary: REDbot is lint for HTTP.
5
5
  Author-email: Mark Nottingham <mnot@mnot.net>
6
6
  License-Expression: MIT
@@ -2,7 +2,7 @@
2
2
  This is the Resource Expert Droid.
3
3
  """
4
4
 
5
- __version__ = "2.4.1"
5
+ __version__ = "2.4.2"
6
6
  __author__ = "Mark Nottingham <mnot@mnot.net>"
7
7
  __copyright__ = """\
8
8
  Copyright (c) 2008- Mark Nottingham
@@ -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.response_content_processors.append(self._link_parser.feed_bytes)
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)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: redbot
3
- Version: 2.4.1
3
+ Version: 2.4.2
4
4
  Summary: REDbot is lint for HTTP.
5
5
  Author-email: Mark Nottingham <mnot@mnot.net>
6
6
  License-Expression: MIT
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