ERP5Type/patches/WSGIPublisher: Emulate HTTPResponse.write better.
Once a response has been written to, the status and headers are supposed to have been sent over the network. So any future change to them is moot. Likewise, setBody does nothing: only write can continue appending to the existing body. As in the case of WSGI the response does not actually get sent just yet: - lock the body - store finalize() result Also, make the order in which body and stdout are returned consistent with HTTPResponse: body is returned first (as part of HTTPResponse.write's call to self.outputBody, which calls self.__str__, which emits body), and then stdout content. Also, add support for cases whre the existing body is a file or an IUnboundStreamIterator.
Showing
Please register or sign in to comment