-
Notifications
You must be signed in to change notification settings - Fork 101
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
Allow for the server to respond with metadata #164
Comments
Thanks for the kind words!
The server can always add additional metadata to the upload that the client can fetch using a HEAD request. Using that workaround that is already possible.
That depends on the clients, of course. tus-js-client, for example, allows to obtain the responses from the server to inspect them for additional data.
We're always open a discussion, yes. You might also want to look into #159 where the topic of post-processing also appears. |
This means it has to be a header yes? We have just enough metadata I'm not super comfortable sticking it in a header, because certain proxies have limits on how long headers can be (I believe NGINX is such an example), but I guess we could break it up between lots of different headers, which may work... Or I guess I could return a 200 from a PATCH request (instead of the 204 tusd responds with) and set the metadata there on the final upload.
I'll hop into that discussion and see if I can be helpful. |
Yes, metadata is transported using the Upload-Metadata header.
👍 |
Should we clarify this in the spec? The only mention of client/server that I can find right now is this which gives the impression that only the client can supply metadata.
|
Good point, yes we should do that! |
After reading the spec a couple of more times, I'm wondering if the server can actually change the metadata? It seems that this is explicitly forbidden in the current spec:
"As specified by the Client during the creation" being the key part. If the Server changes the metadata it is no longer "as specified by the Client" unless the Server's changes are not included in the |
I would have expected that after a successful upload, the server would send a Location header. Then the client could use this Location header to inquire about relevent metadata, possibly at a different endpoint, as this additional metadata looks to me to be outside of the tus protocol. For example: "Location https://service/uploads/path" -> "GET https://service/metadata?location=uploads/path" |
You are right, I forgot about that wording. IIRC, we added this sentence so that servers cannot change metadata keys that were sent by the client. For example, the client sets
This would also be a possible approach we have thought about. Maybe you want to take a look at the discussion at #159 and especially the comment at #159 (comment). |
@Acconut I think it's a fair trade off so I'll just skip the PR for clarifying the spec and leave it to the upcoming post processing extension. |
Hello, I just stumbled across TUS today, and I think it's awesome! Thanks for working on this.
I'd like to use this for my company's uploads, but the server does some post processing after uploading to add some metadata (think things like image dimensions, exif data, video length, etc). I don't see a place in the protocol to allow for responding with extra information upon completion, and the client's don't seem to expose the final server response in order to extract information like this.
Would a maintainer accept an extension to the protocol to allow for such server-based postprocessing?
The text was updated successfully, but these errors were encountered: