Skip to content

Commit

Permalink
Added: max_sample_size configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
mnot committed Dec 18, 2023
1 parent 61e867f commit ea49fe1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ max_links = 100
# expensive, and may cause redbot_daemon to be unresponsive.
content_links = no

# The largest response content sample size. Default 8K; set to zero to disable limit.
# Note that making this too large can cause issues.
max_sample_size = 8192

## Web server configuration

Expand Down Expand Up @@ -89,7 +92,7 @@ enable_local_access = False

# Captcha provider; must be one of:
# - hcaptcha -- see: https://www.hcaptcha.com
* - turnstile -- see: https://www.cloudflare.com/products/turnstile/
# - turnstile -- see: https://www.cloudflare.com/products/turnstile/
# Comment out to disable.
# captcha_provider = turnstile

Expand Down
2 changes: 1 addition & 1 deletion redbot/resource/fetch.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def __init__(self, config: SectionProxy) -> None:
self.response_content_sample: List[Tuple[int, bytes]] = []
self.response_decoded_sample: List[bytes] = []
self.response_decoded_complete: bool = True
self.max_sample_size = 1024 * 10
self.max_sample_size = config.getint("max_sample_size", fallback=8192)

self.request = HttpRequestLinter()
self.nonfinal_responses: List[HttpResponseLinter] = []
Expand Down

0 comments on commit ea49fe1

Please sign in to comment.