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

Implement ASGI extra http.response.pathsend #82

Closed
gi0baro opened this issue May 27, 2023 · 0 comments · Fixed by #171
Closed

Implement ASGI extra http.response.pathsend #82

gi0baro opened this issue May 27, 2023 · 0 comments · Fixed by #171
Labels
asgi Issue related to ASGI protocol pycon
Milestone

Comments

@gi0baro
Copy link
Member

gi0baro commented May 27, 2023

As suggested by @Kludex

ASGI protocol might take advantage of granian capability of directly serve files from a path, like already implemented in RSGI proto.response_file.

This would require to open up a PR to https://github.com/django/asgiref adding the new extra, which might look like the following:

"scope": {
    ...
    "extensions": {
        "http.response.file_path": {},
    },
}

With the above extra definition, a new event might be produced by ASGI applications, with the following keys:

  • type (Unicode string): "http.response.file_path"
  • file_path (Unicode string): The string representation of the file path to serve (platform specific)

The ASGI application is still responsible to send the http.response.start event with the relevant headers (eg: content-type, content-length, etc.)

@gi0baro gi0baro added asgi Issue related to ASGI protocol pycon labels May 27, 2023
@gi0baro gi0baro changed the title Implement ASGI extra http.response.file_path Implement ASGI extra http.response.pathsend Sep 25, 2023
@gi0baro gi0baro added this to the 0.7 milestone Sep 25, 2023
@gi0baro gi0baro modified the milestones: 0.7, 0.8 Oct 16, 2023
@gi0baro gi0baro modified the milestones: 0.8, 1.0 Nov 29, 2023
gi0baro added a commit that referenced this issue Jan 10, 2024
gi0baro added a commit that referenced this issue Jan 10, 2024
gi0baro added a commit that referenced this issue Jan 10, 2024
gi0baro added a commit that referenced this issue Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
asgi Issue related to ASGI protocol pycon
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant