Skip to content

fix render: write content length in Data.Render #4206

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

dengaleev
Copy link

This PR fixes an issue where the Content-Length header is not set correctly for large data written by ResponseWriter.Write. According to the Go documentation, the Content-Length header is automatically added only for small data sizes. For larger data, it is necessary to explicitly set the Content-Length header to ensure proper behavior.

@dengaleev
Copy link
Author

Hi, @appleboy

Could you check this pull request?

Copy link

codecov bot commented Apr 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 99.00%. Comparing base (3dc1cd6) to head (c4e549a).
Report is 99 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4206      +/-   ##
==========================================
- Coverage   99.21%   99.00%   -0.22%     
==========================================
  Files          42       44       +2     
  Lines        3182     3405     +223     
==========================================
+ Hits         3157     3371     +214     
- Misses         17       24       +7     
- Partials        8       10       +2     
Flag Coverage Δ
?
--ldflags="-checklinkname=0" -tags "sonic avx" 98.99% <100.00%> (?)
-tags go_json 98.99% <100.00%> (?)
-tags nomsgpack 98.98% <100.00%> (?)
go-1.18 ?
go-1.19 ?
go-1.20 ?
go-1.21 ?
go-1.23 99.00% <100.00%> (?)
go-1.24 99.00% <100.00%> (?)
macos-latest 99.00% <100.00%> (-0.22%) ⬇️
ubuntu-latest 99.00% <100.00%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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