Skip to content

Metadata parameters#8

Open
KatamariJr wants to merge 2 commits intofentas:masterfrom
KatamariJr:metadata
Open

Metadata parameters#8
KatamariJr wants to merge 2 commits intofentas:masterfrom
KatamariJr:metadata

Conversation

@KatamariJr
Copy link

Adds some features to make it a little bit easier to add metadata to a request per #7 . Values need to be base64 encoded before they are passed as parameters, but its a start.

Adds two new params:
-n : automatically adds the "name" metadata value as it was doing already
-m : accepts a list of key-value pairs, and passes them along into the Upload-Metadata header. Invoker must take care of base64 encoding the values themselves beforehand.

Copy link
Owner

@fentas fentas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR 👍

I think we could change this so that -n is not necessary so that TUS_METADATA is an assoc array and add as default the name and later we parse -m argument as key value[, ...] and add it to TUS_METADATA. This would allow overwriting the name.

What do you think?

> default: 1
-H HEADER Set additional header.
-r Reuploads given file from the beginning.
-n Add the filename to the Upload-Metadata.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This would be a breaking change as the default behaviour atm is that the name is auto appended. Problem?

@KatamariJr
Copy link
Author

I agree with all those points you made! I dont know enough about shell to know how to split a list of params into an associative array like that, but if you point me in the right direction or give an example, I could implement it!

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 this pull request may close these issues.

2 participants