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

Empty request data is never read #64

Open
ilyapuchka opened this issue Nov 22, 2018 · 2 comments
Open

Empty request data is never read #64

ilyapuchka opened this issue Nov 22, 2018 · 2 comments

Comments

@ilyapuchka
Copy link

ilyapuchka commented Nov 22, 2018

When POST request is received by the server it is natural to attempt to read its body data. But when no data is sent or empty data is sent in request body then data reader closure is never called resulting in request never complete. There is no other way except attempting to read data to know if any data is sent at all.
#65 adds test that demonstrates this issue

@sa-spag
Copy link

sa-spag commented Jan 14, 2019

environ["HTTP_CONTENT_LENGTH"] is nil when there is no request body:

if environ["HTTP_CONTENT_LENGTH"] != nil {
    DataReader.read(input) { data in
        ...
        handler()
    }
} else {
    handler()
}

@kunimei
Copy link

kunimei commented Feb 19, 2023

good thankyou

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

3 participants