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

Add support for ASGI pathsend extension #2435

Merged
merged 2 commits into from
Jan 22, 2024
Merged

Conversation

gi0baro
Copy link
Contributor

@gi0baro gi0baro commented Jan 22, 2024

Summary

As per title, this adds support for ASGI pathsend extension on FileResponse class for servers implementing it.

Checklist

  • I understand that this PR may be closed in case there was no previous discussion. (This doesn't apply to typos!)
  • I've added a test for each change that was introduced, and I tried as much as possible to make a single atomic change.
  • I've updated the documentation accordingly.

Copy link
Member

@Kludex Kludex left a comment

Choose a reason for hiding this comment

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

We need tests.

@abersheeran is this the only thing needed on the implementation side?

@abersheeran
Copy link
Member

@abersheeran is this the only thing needed on the implementation side?

Yes, its actual logic implementation is all on the server side.

@gi0baro
Copy link
Contributor Author

gi0baro commented Jan 22, 2024

@Kludex I added a test for this, but it only test the correctness of the messages as TestClient doesn't support pathsend directly. Let me know if this is ok for you.

@Kludex
Copy link
Member

Kludex commented Jan 22, 2024

Reference of the previous PR regarding this extension: #1288

@gi0baro
Copy link
Contributor Author

gi0baro commented Jan 22, 2024

Reference of the previous PR regarding this extension: #1288

🤔 http.response.zerocopysend (ASGI ref) != http.response.pathsend (ASGI ref)

@Kludex
Copy link
Member

Kludex commented Jan 22, 2024

OHHHH, this is the one you created. Sorry!

@Kludex Kludex merged commit 7936e86 into encode:master Jan 22, 2024
5 checks passed
@Kludex
Copy link
Member

Kludex commented Jan 22, 2024

Thanks @gi0baro 🙏

nixroxursox pushed a commit to nixroxursox/starlette that referenced this pull request Mar 18, 2024
* add support for ASGI `pathsend` extension

* add test for ASGI `pathsend`
gi0baro added a commit to gi0baro/starlette that referenced this pull request Jul 23, 2024
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.

3 participants