tus / tusd

Reference server implementation in Go of tus: the open protocol for resumable file uploads
https://tus.github.io/tusd
MIT License
3.08k stars 479 forks source link

How to return relative URL? #332

Open endeverchen opened 4 years ago

endeverchen commented 4 years ago

Question I use tusd as a lib in my server which is behind several proxies, and it's hard to configure to return absolute URL to the client. The prototol defines the URL may be absolute or relative, but I can't find a way to return relative URL. Is there a way to return relative URL?

Setup details Please provide following details, if applicable to your situation:

Acconut commented 4 years ago

Is there a way to return relative URL?

No, tusd has currently no way to return relative URLs. If that's a must for you, you would have to wrap a HTTP handler around tusd and modify the Location header to turn the absolute URL into a relative one.

endeverchen commented 4 years ago

Thanks. I tried to wrap a HTTP handler and now it works well, but the code gets complicated. Since the protocol allows to return relative link, will it be a feature in the future?

Acconut commented 4 years ago

We would be happy to accept a PR to support relative links but we currently do not have the resources to work on this on our own.

erlendvollset commented 3 years ago

Need this aswell. Would be great to get this in!

Acconut commented 3 years ago

@erlendvollset Feel free to open a PR or an issue to discuss implementation details if you are interested in helping. We are currently too low on resources to implement it on our own.