Add: allow setting Authorization / Upload-Token in Metadata for tus-clients #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When you upload via a webinterface in the development setup, tusd
is running on a different port than the API server. This means CORS
is in control if you are allowed to call tusd. In the current
implementation of tusd, it is not possible to modify the CORS headers,
and the author has been very strict that this is not going to change.
The CORS headers tusd does send are, rightfully, very strict, and
do not allow these two new headers to be send. In result, uploading
to tusd over via a website is not working for a development setup.
In production this is not a problem, because there everything is on
the same URL.
To still allow development setups to work, it is now okay to send
these two headers via the Metadata. This has some downsides, for
example a WAF can no longer validate these requests. Or for example
caching doesn't spot the Authorization header, not knowing how to
cache correctly. For now, this is not an issue, as we don't use a
WAF (and are unlikely to ever use one), and we can put the whole
tus path on "do-not-cache".
Nevertheless, this is a hack.