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

'Location' expects absolute URL #43

Open
jkoplo opened this issue Nov 12, 2020 · 0 comments
Open

'Location' expects absolute URL #43

jkoplo opened this issue Nov 12, 2020 · 0 comments

Comments

@jkoplo
Copy link

jkoplo commented Nov 12, 2020

So I've been doing some testing using tusc, which is a statically compiled binary using this library. Everything worked great with it when using tusd as the server. But then I switched to my application that is built with tuscdotnet and the PATCH call started failing with an error about a missing server.

It turns out that tuscdotnet returns a relative path for location (Location: files/24e533e02ec3bc40c387f1a0e460e216) whereas the tusd implementation returns an absolute path (Location: https://tus.example.org/files/24e533e02ec3bc40c387f1a0e460e216).

According to the spec, either is acceptable, but the absolute is always shown in examples:

The Server MUST acknowledge a successful upload creation with the 201 Created status. The Server MUST set the Location header to the URL of the created resource. This URL MAY be absolute or relative.

So it seems that the location value needs to be checked and converted to an absolute path before the PATCH call. I'd attempt a PR, but I'm not familiar with golang at all.

@jkoplo jkoplo changed the title 'Location' returns relative instead of absolute 'Location' expects absolute URL Nov 12, 2020
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 a pull request may close this issue.

1 participant