Update HTTPServerResponse.cpp

This commit is contained in:
Alexey Milovidov 2024-02-26 03:34:35 +03:00 committed by GitHub
parent 2edb3d5ba1
commit 34e85959c1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -125,15 +125,15 @@ void HTTPServerResponse::requireAuthentication(const std::string & realm)
void HTTPServerResponse::redirect(const std::string & uri, HTTPStatus status) void HTTPServerResponse::redirect(const std::string & uri, HTTPStatus status)
{ {
poco_assert(!stream); poco_assert(!stream);
setContentLength(0); setContentLength(0);
setChunkedTransferEncoding(false); setChunkedTransferEncoding(false);
setStatusAndReason(status); setStatusAndReason(status);
set("Location", uri); set("Location", uri);
// Send header // Send header
Poco::Net::HTTPHeaderOutputStream hs(session); Poco::Net::HTTPHeaderOutputStream hs(session);
write(hs); write(hs);
hs.flush(); hs.flush();