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
feat: #381 #385
base: master
Are you sure you want to change the base?
feat: #381 #385
Conversation
@@ -101,10 +102,14 @@ exports.createContainer = function (options, callback) { | |||
container: containerName | |||
}; | |||
|
|||
var headers = options.headers || {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This appears to allow passing arbitrary headers to createContainer? If so, that should be added in the documentation at https://github.com/pkgcloud/pkgcloud/pull/385/files#diff-c4a3a7c9ff3534d7a13bcb9345003bc3L92, as well as in the documentation.
I'm excited about the contribution. One question I have is should we sanitize the inbound headers? |
Sanitization at client is not neccessary, as the backend will tell if a header is allowed or disallowed. |
@@ -33,6 +33,8 @@ A Container for Openstack has following properties: | |||
bytes: 12345, // size of the container in bytes | |||
metadata: { // key value pairs for the container | |||
// ... | |||
}, | |||
headers: { // response headers when request a container |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
response headers
should be request headers
I have test it is OK. Remove headers: client.removeContainerHeaders(container, {
'X-Remove-Container-Read': '.r:*'
}, function() {}); |
#381
Set headers:
Update headers:
Remove headers: