Retains HTTP Context values
As discussed in #443, revival of the pull request #342 , to which I have added a unit test as requested in the comments.
The unit test ensure that value in request context is accessible in datastore. The original PR is a Copypasta of @Acconut solution to #315 by @innovate-invent
I rebase previous PR onto master.
It could solve issues #443, and related to #361 and #309.
Any plans this PR to be accepted?
Ive just ran into this issue as well. Im delegating to tusd Handler from the iris framework which has to do auth via a jwt middleware, and need to ensure the tus store is aware of the auth state data via context to save to the database properly.
Given the current situation, will likely have to fork.
I somehow forgot this PR, but I will revisit it soon. Thanks for reminding me.
ping
This seems to be the "go" way to do things. Is there a reason to not use the request context when doing things?
Is there a reason to not use the request context when doing things?
The request context is cancelled if the request is aborted. But we want to continue performing tasks after the request is aborted, such as saving the last received bytes to S3. This cannot be done if we use the request context.
Thanks you for your contribution! In tusd v2, the request context will be accessible in the hooks and stores. Please see #986 for more details and #672 for the development of v2.