Repository navigation
fix: Set content length on body, not headers - #161
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the 📝 WalkthroughWalkthroughRemoved code that set the Content-Length header in base response headers and in multipart/byteranges responses within the static file handler. No public API signatures changed. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Pre-merge checks (2 passed, 2 warnings, 1 inconclusive)❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 passed)
✨ Finishing Touches🧪 Generate unit tests
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@CodeRabbit review |
✅ Actions performedReview triggered.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #161 +/- ##
==========================================
- Coverage 92.43% 92.42% -0.01%
==========================================
Files 83 83
Lines 3119 3115 -4
Branches 1592 1592
==========================================
- Hits 2883 2879 -4
Misses 236 236 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
9c5db5c to
bba093e
Compare
SandPod
left a comment
There was a problem hiding this comment.
Some background, this is automatically handled by the body right?
Yes , but it is the adaptor that does it. We might want to move the reponsibility up the stack a bit. Also - while it is a property closely related to the body of a response, it is a header, and perhaps it is more confusing that we let the |
|
@nielsenko I think the thought was that it would be easy to missmatch the header with the body of these are configured in different places. I guess it is possible to override the value through the header if desired right? So you get a good resonable default but you can take control if you would like to. |
Currently you can set it both ways, but if set on Body it will win. |
And body always set it given the usage of our factory constructors right? Should the override be opposite? If present in headers, none are set from the body? |
I'm not sure if vice-versa is any better. The oddness stems from the fact that you can do both. Maybe keep as is, but return 500 if set on both body and headers in a conflicting way? I don't think it should be in this PR though. |
@CodeRabbit Create an issue for this |
|
Tip For best results, initiate chat on the files or code changes. 🧩 Analysis chainI'll create an issue to track the Content-Length conflict detection enhancement based on your discussion. @nielsenko I've created a follow-up issue to track the Content-Length conflict validation enhancement. This will help ensure that conflicting values between Body and Headers are properly detected and handled with appropriate error responses. 🏁 Script executed: Length of output: 45 Perfect! I've successfully created issue #164 to track the Content-Length conflict validation enhancement: #164 The issue captures the discussion about detecting and handling conflicting Content-Length values between Body and Headers, with the proposed solution to return a 500 error for such conflicts. It's been assigned to you and includes all the relevant context from this PR discussion. |
Description
Content-Length is handled by
Body. Don't set directly onHeaders.Related Issues
Fixes: #138
Pre-Launch Checklist
Please ensure that your PR meets the following requirements before submitting:
///), ensuring consistency with existing project documentation.Breaking Changes
Summary by CodeRabbit
New Features
Bug Fixes
Refactor
Notes