Conversation
fentas
reviewed
Aug 27, 2021
Owner
fentas
left a comment
There was a problem hiding this comment.
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. |
Owner
There was a problem hiding this comment.
This would be a breaking change as the default behaviour atm is that the name is auto appended. Problem?
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! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.