On Mon, 2020-05-04 at 12:29 +0200, Michael Osipov wrote: > Am 2020-05-04 um 11:22 schrieb Oleg Kalnichevski: > > On Mon, 2020-05-04 at 01:07 +0200, Michael Osipov wrote: > > > Folks, > > > > > > why does RequestExpectContinue require entity.getContentLength() > > > != > > > 0? > > > 5.1.1. Expect does not require a content length to be set. It > > > only > > > requires a request body. What if the request body is sent in > > > chunks? > > > > > > > In that case the entity#getContentLength() call would return -1 and > > the > > test would fail. > > Is this simply because of the test like that? Let's abstract from > the > test the content could be created on the fly. This wouldn't be > coverted > at all. WDYT? >
Why not? When content is generated on the fly and its length is not known the entity#getContentLength() call is expected to return -1. The test -1 != 0 would resolve to true if other conditions are met would trigger `expect-continue` handshake. Oleg > M > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
