-
Notifications
You must be signed in to change notification settings - Fork 4
fix(viewer): doesn't write body when it is HEAD request #42
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's Guide by SourceryThis PR fixes an issue where response bodies were written even for HEAD requests. The implementation now uses a conditional check in each viewer's Render method to ensure that content is only rendered and written when the request method is not HEAD. This change has been applied across all viewer types (HTML, JSON, Text, XML, and String), and the header is set appropriately based on the viewer type. No diagrams generated as the changes look simple and do not need a visual representation. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Here's the code health analysis summary for commits Analysis Summary
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @cnlangzi - I've reviewed your changes - here's some feedback:
Overall Comments:
- Consider creating a common render function to avoid duplicating the HEAD request check and buffer logic.
Here's what I looked at during the review
- 🟡 General issues: 1 issue found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #42 +/- ##
==========================================
+ Coverage 91.97% 92.38% +0.41%
==========================================
Files 43 43
Lines 1644 1654 +10
==========================================
+ Hits 1512 1528 +16
+ Misses 97 93 -4
+ Partials 35 33 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
Changed
Fixed
HEAD
requestAdded
Tests
Tasks to complete before merging PR:
make unit-test
to check for any regressions 📋make lint
to check for any issuesSummary by Sourcery
Bug Fixes: