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

Add: allow setting Authorization / Upload-Token in Metadata for tus-clients #13

Closed
wants to merge 1 commit into from

Conversation

TrueBrain
Copy link
Member

@TrueBrain TrueBrain commented Apr 18, 2020

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.

@TrueBrain TrueBrain changed the title Add: allow setting Authorization / Upload-Token in Metadata for tus-c… Add: allow setting Authorization / Upload-Token in Metadata for tus-clients Apr 18, 2020
…lients

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.
@TrueBrain
Copy link
Member Author

This solution is not going to work, as the headers are only given in pre-create. The other hooks don't have them.

@TrueBrain TrueBrain closed this Apr 18, 2020
@TrueBrain TrueBrain deleted the bypass_web branch October 30, 2021 08:15
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.

None yet

1 participant