takes icon indicating copy to clipboard operation
takes copied to clipboard

Only print body if there is a body

Open laeubi opened this issue 1 year ago • 1 comments

Currently reading from a request can hang forever if there is no content available (e.g. GET / HEAD / DELETE / ...).

This adds a check if any of the content headers are there to indicate that actually something can be read.

Follow-Up for

  • https://github.com/yegor256/takes/pull/1302

laeubi avatar Aug 02 '24 08:08 laeubi

Okay that don't work, because it seems some tests write a body without any content headers (what theoretically is allowed for HTTP 1.0 on connection close)... I'll have to think a little bit more about this.

laeubi avatar Aug 02 '24 10:08 laeubi

@laeubi Thanks for your contribution! Unfortunately, we can't merge it without tests. Every feature we add and every bug we fix must be accompanied by at least one new test that confirms that the code was not working before. Without such a test, how can we know that what you commit actually works?

yegor256 avatar Oct 01 '25 05:10 yegor256