TUSKit icon indicating copy to clipboard operation
TUSKit copied to clipboard

Metadata field regression

Open andrestone opened this issue 2 years ago • 5 comments

This PR makes this implementation behave different from tus-js-client (at least) with regards to how custom metadata is packaged.

Currently, there's no straight-forward way to add a custom entry to the Upload-Metadata header directly.

andrestone avatar Aug 17 '22 16:08 andrestone

Hi @andrestone,

Could you elaborate on what you mean with the lack of a straight-forward way to add a custom entry? All the public upload methods in the client accept custom headers, which should be sufficient for most use cases.

tursunovic avatar Aug 17 '22 19:08 tursunovic

The custom headers are not added as fields on the Upload-Metadata HTTP header. It seems like, after that PR, the custom headers are added as a separate dictionary.

This behavior is not consistent with the JS client implementation.

andrestone avatar Aug 17 '22 19:08 andrestone

Thanks for the clarification. Looking at the docs of the tus-js-client is see this about headers:

An object with custom header values used in all requests. Useful for adding authentication details, for example:

headers: {
    "Authorization": "Bearer ..."
}

That is also how it's currently used in this library. Perhaps I'm missing something, could you point out where the difference is?

tursunovic avatar Aug 17 '22 20:08 tursunovic

It's about being able to add to a specific header (Upload-Metadata). https://github.com/tus/tus-js-client/blob/master/docs/api.md#metadata

andrestone avatar Aug 19 '22 09:08 andrestone

Ahh I see. You are right, will fix this and follow up soon.

tursunovic avatar Aug 22 '22 16:08 tursunovic

Sounds like the issue is fixed here but still waiting on a package release with it https://github.com/tus/TUSKit/pull/143

jdcalvin avatar Dec 16 '22 19:12 jdcalvin

We hope to release a new version in the next two weeks with this fix included.

Acconut avatar Jan 18 '23 13:01 Acconut

It took a little bit longer than we’d have liked but we currently have a release out. You can update to 3.1.5 to pull in the fixes mentioned here 👍🏼

donnywals avatar Feb 14 '23 08:02 donnywals