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

Metadata parameters #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

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?

@@ -38,6 +39,11 @@ Options:
> 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