tusd icon indicating copy to clipboard operation
tusd copied to clipboard

How to return relative URL?

Open endeverchen opened this issue 5 years ago • 5 comments

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:

  • Operating System: Linux
  • Used tusd version: latest
  • Used tusd data storage:
  • Used tusd configuration:
  • Used tus client library:

endeverchen avatar Dec 17 '19 07:12 endeverchen

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.

Acconut avatar Dec 17 '19 09:12 Acconut

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?

endeverchen avatar Dec 19 '19 01:12 endeverchen

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.

Acconut avatar Dec 19 '19 07:12 Acconut

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

erlendvollset avatar May 21 '21 18:05 erlendvollset

@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.

Acconut avatar May 25 '21 11:05 Acconut