Skip to content

Add support for ASGI pathsend extension#2435

Merged
Kludex merged 2 commits into
Kludex:masterfrom
gi0baro:asgi-pathsend
Jan 22, 2024
Merged

Add support for ASGI pathsend extension#2435
Kludex merged 2 commits into
Kludex:masterfrom
gi0baro:asgi-pathsend

Conversation

@gi0baro

@gi0baro gi0baro commented Jan 22, 2024

Copy link
Copy Markdown
Contributor

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.

@Kludex Kludex left a comment

Copy link
Copy Markdown
Owner

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
Copy Markdown
Contributor

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

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

@gi0baro

gi0baro commented Jan 22, 2024

Copy link
Copy Markdown
Contributor Author

@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

Kludex commented Jan 22, 2024

Copy link
Copy Markdown
Owner

Reference of the previous PR regarding this extension: #1288

@gi0baro

gi0baro commented Jan 22, 2024

Copy link
Copy Markdown
Contributor Author

Reference of the previous PR regarding this extension: #1288

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

@Kludex

Kludex commented Jan 22, 2024

Copy link
Copy Markdown
Owner

OHHHH, this is the one you created. Sorry!

@Kludex Kludex merged commit 7936e86 into Kludex:master Jan 22, 2024
@Kludex

Kludex commented Jan 22, 2024

Copy link
Copy Markdown
Owner

Thanks @gi0baro 🙏

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