How do HTTP servers figure out Content-Length?

Testing my website for visual regressions with Playwright snapshot tests