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

KTOR-4379 Validate body size equals Content-Length #3069

Merged
merged 3 commits into from Jun 27, 2022

Conversation

e5l
Copy link
Member

@e5l e5l commented Jun 23, 2022

Fix KTOR-4379

@e5l e5l self-assigned this Jun 23, 2022
@e5l e5l requested a review from rsinukov June 23, 2022 12:34
@e5l e5l force-pushed the e5l/validate-content-length branch from 4721952 to a36b62c Compare June 23, 2022 12:36
@rsinukov
Copy link
Contributor

Please check CI

@e5l
Copy link
Member Author

e5l commented Jun 24, 2022

@rsinukov, thanks. done

@rsinukov
Copy link
Contributor

JS and Native builds are still failing

@e5l e5l force-pushed the e5l/validate-content-length branch from 1a4b288 to 2996cbd Compare June 24, 2022 12:04
@e5l
Copy link
Member Author

e5l commented Jun 24, 2022

@rsinukov, thanks. Updated

Copy link
Contributor

@rsinukov rsinukov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but minor comments


if (!upgraded && event is LastHttpContent) {
current.close()
checkCurrentLengthAndClose()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it redundant, since this check is in finally block?

Copy link
Member Author

@e5l e5l Jun 27, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope: the next message can be a new channel in the pipeline or upgrade

current?.close()
current = event
is ChannelEvent -> {
checkCurrentLengthAndClose()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here

@e5l e5l merged commit 2fffabe into main Jun 27, 2022
@e5l e5l deleted the e5l/validate-content-length branch June 27, 2022 06:25
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

Successfully merging this pull request may close these issues.

None yet

2 participants