Add support for ASGI pathsend
Close #569
@RobertoPrevato regarding tests, do you have any advice? I don't see any specific tests for the scribe module. Should I just add a test in test_responses for this?
Thanks @gi0baro for contributing! Regarding tests, I didn't include tests specific to the scribe namespace because most functions of the Cython code are defined as cdef for best performance, and cannot be imported from Python code. Yes, I would probably add more tests to test_responses, or add a dedicated module for this feature if that makes sense.
Thanks @gi0baro, Sorry for taking such a long time to come back to this. ~~I understand your PR is complete and can be merged, correct?~~ I plan to release a new version to PyPi this weekend.
I just tested with Granian and it seems to fail serving files (unless I am doing something wrong). Please let me know if I can help with anything for this PR.
Hey @RobertoPrevato
I'm the one who actually feels sorry for this; I hadn't chance to continue working on this since my last comment. The current implementation kinda provides the low-level requirements for pathsend to work, but this is definitely missing:
- tests
- user-facing implementations (that should relay on the current work) like
app.serve_filesblacksheep.server.responses.file
I'm not sure I'll have time to work on this in the near future, but I can get back to you as soon as I have some time.
To add a bit of context, essentially this should produce a different set of ASGI response messages for files coming from an existing path when the ASGI scope mention the extension availability.
Hi @gi0baro No worries, and thank you again for your help.