8000 Call `on_eos` for successful streams by mladedav · Pull Request #580 · tower-rs/tower-http · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Call on_eos for successful streams #580

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

Merged
merged 1 commit into from
Jun 19, 2025
Merged

Conversation

mladedav
Copy link
Contributor
@mladedav mladedav commented Jun 5, 2025

Motivation

Fixes #550.

on_eos is called only if classification declares that it cannot classify the response until eos.

The documentation does not mention such limitation.

Solution

Pass the callback to the response body for it to be called even if it's not needed for response classification.

@mladedav
Copy link
Contributor Author
mladedav commented Jun 5, 2025

I had to fix two tests that assert that eos is not called so this might in fact be documentation issue although I suspect the test was just done in a way that it would pass without conscious decision that eos should be ignored unless it is needed for classifications.

Also somewhat related is #483 which also fixes an issue related to eos in Trace.

@mladedav
Copy link
Contributor Author

@jplatte would you mind taking a look? It would help me a lot if this made it into the next release (whenever that might be)

@jplatte jplatte requested review from jplatte June 18, 2025 08:48
Copy link
Member
@jplatte jplatte left a comment

Choose a reason for hiding this comment

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

Seems to match what the documentation says this does.

@jplatte jplatte merged commit bd397ca into tower-rs:main Jun 19, 2025
11 checks passed
@mladedav mladedav deleted the dm/eos branch June 19, 2025 10:41
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.

tower_http::trace::OnEos only called if EOS is classified
2 participants
0