WebServer: Set Content-Length: 0 header during redirection

Fixes #26431

Ref: https://bugs.python.org/issue43972
This commit is contained in:
Gurkirat Singh
2026-04-06 20:22:43 +05:30
committed by Nico Weber
parent 0c9c0ba44c
commit 6c9677f27d

View File

@@ -228,6 +228,7 @@ ErrorOr<void> Client::send_redirect(StringView redirect_path, HTTP::HttpRequest
{
StringBuilder builder;
TRY(builder.try_append("HTTP/1.0 301 Moved Permanently\r\n"sv));
TRY(builder.try_append("Content-Length: 0\r\n"sv));
TRY(builder.try_append("Location: "sv));
TRY(builder.try_append(redirect_path));
TRY(builder.try_append("\r\n"sv));