Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LiteSpeed ignores requests pipelined after requests with chunked message bodies #402

Open
kenballus opened this issue Jul 9, 2024 · 0 comments

Comments

@kenballus
Copy link

kenballus commented Jul 9, 2024

When LiteSpeed receives a pipeline in which the first request is chunked, the rest of the requests in the pipeline are ignored, but the connection is not closed, and further requests will be processed in a short period of time.

This can be demonstrated by running the following command on a server running LiteSpeed on port 80:

(
    printf 'POST /a HTTP/1.1\r\nHost: whatever\r\nTransfer-Encoding: chunked\r\n\r\n0\r\n\r\nGET /b HTTP/1.1\r\nHost: whatever\r\n\r\n'
    sleep 1
    printf 'DELETE /c HTTP/1.1\r\nHost: whatever\r\n\r\n'
) | nc localhost 80

You should see the server respond to the POST and the DELETE request, but not the GET (presumably due to the sleep).

I have tested this on LiteSpeed 1.8.1 by using a simple application that echos received request methods. You can reproduce my setup exactly using the Dockerfile here.

This is the output of the above command inside of the resulting Docker container:

HTTP/1.1 200 OK
content-type: text/html; charset=UTF-8
content-length: 141
date: Tue, 09 Jul 2024 20:23:49 GMT
server: LiteSpeed
connection: Keep-Alive

{"headers":[["SG9zdA==","d2hhdGV2ZXI="],["Q29udGVudC1MZW5ndGg=","MA=="]],"body":"","method":"UE9TVA==","uri":"L2E=","version":"SFRUUC8xLjE="}HTTP/1.1 200 OK
content-type: text/html; charset=UTF-8
content-length: 109
date: Tue, 09 Jul 2024 20:23:50 GMT
server: LiteSpeed
connection: Keep-Alive

{"headers":[["SG9zdA==","d2hhdGV2ZXI="]],"body":"","method":"REVMRVRF","uri":"L2M=","version":"SFRUUC8xLjE="}

Base64-decoding the method fields in the above JSON objects shows that only the POST and DELETE were responded to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant