From 827044f804bcae8794c29e709b96b764c5182384 Mon Sep 17 00:00:00 2001 From: okapui <92432738+okapui@users.noreply.github.com> Date: Tue, 24 Feb 2026 03:20:19 +0900 Subject: [PATCH] Include Content-Length in 404 response (#1393) --- .../Demo_IP_Protocols/HTTP_Server/FreeRTOS_HTTP_server.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/FreeRTOS-Plus/Demo/Common/Demo_IP_Protocols/HTTP_Server/FreeRTOS_HTTP_server.c b/FreeRTOS-Plus/Demo/Common/Demo_IP_Protocols/HTTP_Server/FreeRTOS_HTTP_server.c index d61f241ec78..93d62d8b9f0 100644 --- a/FreeRTOS-Plus/Demo/Common/Demo_IP_Protocols/HTTP_Server/FreeRTOS_HTTP_server.c +++ b/FreeRTOS-Plus/Demo/Common/Demo_IP_Protocols/HTTP_Server/FreeRTOS_HTTP_server.c @@ -297,6 +297,9 @@ if( pxClient->pxFileHandle == NULL ) { + snprintf( pxClient->pxParent->pcExtraContents, sizeof( pxClient->pxParent->pcExtraContents ), + "Content-Length: 0\r\n" ); + /* "404 File not found". */ xRc = prvSendReply( pxClient, WEB_NOT_FOUND ); }