Skip to content

fix limit html meta response body size#5781

Open
stvgo wants to merge 1 commit intousememos:mainfrom
stvgo:fix/limit-html-meta-response-body-size
Open

fix limit html meta response body size#5781
stvgo wants to merge 1 commit intousememos:mainfrom
stvgo:fix/limit-html-meta-response-body-size

Conversation

@stvgo
Copy link

@stvgo stvgo commented Mar 24, 2026

Summary by CodeRabbit

  • Bug Fixes
    • Enhanced HTTP response handling by implementing a 1 MB size limit on response parsing, improving stability and performance when processing large web content.

@stvgo stvgo requested a review from a team as a code owner March 24, 2026 22:33
@coderabbitai
Copy link

coderabbitai bot commented Mar 24, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: bed92dc3-e76d-4574-a38e-733c3a3b36a3

📥 Commits

Reviewing files that changed from the base of the PR and between 2327f4e and 3f9b5f2.

📒 Files selected for processing (1)
  • plugin/httpgetter/html_meta.go

📝 Walkthrough

Walkthrough

The HTTP response body parsing in the HTML metadata extractor was modified to limit input reading to 1 MB using io.LimitReader, replacing a direct body read. A corresponding TODO comment about size limiting was removed. Functionality remains unchanged except for the enforced size constraint.

Changes

Cohort / File(s) Summary
Response Size Limiting
plugin/httpgetter/html_meta.go
Added io.LimitReader wrapper capped at 1 MB (1<<20 bytes) to bound HTTP response parsing, removed associated TODO comment.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Poem

🐰 A limit we set on the reader's domain,
One megabyte maximum, clear and plain,
No more endless streams to consume,
The metadata dances in bounded room,
Efficient and safe, our code's refrain! 🎉

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: implementing a size limit for HTML meta response body parsing to prevent excessive memory usage.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant