net: http: server: Enable HTTP1.0 request compatibility#101631
Merged
fabiobaltieri merged 1 commit intozephyrproject-rtos:mainfrom Jan 8, 2026
Merged
Conversation
d259089 to
51a3b4b
Compare
yvesll
reviewed
Dec 31, 2025
yvesll
reviewed
Dec 31, 2025
51a3b4b to
d84c737
Compare
jukkar
reviewed
Dec 31, 2025
Member
jukkar
left a comment
There was a problem hiding this comment.
Looks good, just couple of coding style nits.
Per RFC9112 (REF zephyrproject-rtos#1), HTTP/1.1 server is expected to be backward compatible with HTTP1.0 request. Mainly HTTP/1.0 does not support 1) Transfer Encoding : chunked 2) KeepAlives So, this change will identify the HTTP protocol version in the request and respond accordingly. REF# 1) https://httpwg.org/specs/rfc9112.html Tested: 1) Verified that HTTP/1.1 requests are served as usual i.e. with chunked transfer encoding and the connection is a Keep Alive connection Query exits after 10s, indicating that the client connection to the HTTP server is a Keep Alive. ``` time printf "GET /telem HTTP/1.1\r\nHost: 192.0.3.11\r\n\r\n" | nc 192.0.3.11 80 real 0m10.185s <- Indicates connection was kept active for 10s user 0m0.023s sys 0m0.023s ``` `Transfer Encoding : chunked` header and chunked encoding metadata (chunk size hex bytes, crlf, termination byte 0) are present in the response. ``` HTTP/1.1 200 OK Transfer-Encoding: chunked <- Chunked encoding header Content-Type: text/html 3e8 <- Chunk size hex bytes : /health/secondsdevice_ae:9a:22:48:0f:70"seconds0 + /health/locatedevice_ae:9a:22:48:0f:70"0 / /network/mac-addressdevice_ae:9a:22:48:0f:70" . . . 3e8 <- Chunk size hex byte _PLUS_rawdevice_ae:9a:22:48:0f:70"0 6 /dev/ISHARE_CBU_MINUS_rawdevice_ae:9a:22:48:0f:70"0 . . . /dev/part_iddevice_ae:9a:22:48:0f:70"0��������� , /dev/part_typedevice_ae:9a:22:48:0f:70"0 7 /dev/part_telemetry_disabledevice_ae:9a:22:48:0f:70"0 0 <- Termination Byte 0 ``` 2) Verfied that HTTP/1.0 requests are served with response without chunked transfer encoding and the connection is closed immediately. Query exits immediately indicating the connection is closed immediately ``` time printf "GET /telem HTTP/1.0\r\nHost: 192.0.3.11\r\n\r\n" | nc 192.0.3.11 80 real 0m0.186s <- Indicates connection was terminated immediately. user 0m0.018s sys 0m0.030s ``` `Transfer Encoding : chunked` header and chunked encoding metadata (chunk size hex bytes, crlf) not present in the response ``` HTTP/1.1 200 OK Content-Type: text/html : /health/uptimedevice_ae:9a:22:48:0f:70"seconds0 + /health/locatedevice_ae:9a:22:48:0f:70"0 / /network/mac-addressdevice_ae:9a:22:48:0f:70" . . . 3 /dev/part_iddevice_ae:9a:22:48:0f:70"0��������� , /dev/part_typedevice_ae:9a:22:48:0f:70"0 7 /dev/can_telemetry_disabledevice_ae:9a:22:48:0f:70"0 ``` Signed-off-by: Nikhil Namjoshi <[email protected]>
d84c737 to
df60aa6
Compare
|
Contributor
Author
Thanks for the review. I addressed all the inputs. |
jukkar
approved these changes
Jan 6, 2026
yvesll
approved these changes
Jan 7, 2026
rlubos
approved these changes
Jan 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Per RFC9112 (REF #1), HTTP/1.1 server is expected to be backward compatible with HTTP1.0 requests. Mainly HTTP/1.0 clients do not support
So, this change will identify the HTTP protocol
version in the request and respond accordingly.
REF#
Tested:
Query exits after 10s, indicating that the client connection to the HTTP server is a Keep Alive.
Transfer Encoding : chunkedheader and chunked encoding metadata (chunk size hex bytes, crlf, termination byte 0) are present in the response.response without chunked transfer encoding and the connection is closed immediately.
Query exits immediately indicating the connection is closed immediately
Transfer Encoding : chunkedheader and chunked encoding metadata (chunk size hex bytes, crlf) not present in the response