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

feat: #381 #385

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

feat: #381 #385

wants to merge 6 commits into from

Conversation

ghost
Copy link

@ghost ghost commented Jan 8, 2015

#381

Set headers:

client.createContainer({
  name: 'test-container',
  headers: {
    'X-Container-Read': '.r:*'
  }
}, function() {});

Update headers:

client.updateContainerHeaders(container, {
  'X-Container-Read': '.r:*'
}, function() {});

Remove headers:

client.updateContainerHeaders(container, {
  'X-Remove-Container-Read': '.r:*'
}, function() {});

@coveralls
Copy link

Coverage Status

Coverage increased (+0.02%) when pulling e159ea3 on kfll:swift-container-acl into e12b251 on pkgcloud:master.

@@ -101,10 +102,14 @@ exports.createContainer = function (options, callback) {
container: containerName
};

var headers = options.headers || {};
Copy link
Member

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.

@kenperkins
Copy link
Member

I'm excited about the contribution. One question I have is should we sanitize the inbound headers?

@ghost
Copy link
Author

ghost commented Jan 8, 2015

Sanitization at client is not neccessary, as the backend will tell if a header is allowed or disallowed.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.01%) when pulling 19558a2 on kfll:swift-container-acl into e12b251 on pkgcloud:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) when pulling a7a8282 on kfll:swift-container-acl into e12b251 on pkgcloud:master.

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) when pulling 73abba0 on kfll:swift-container-acl into e12b251 on pkgcloud:master.

@@ -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
Copy link
Contributor

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

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.05%) when pulling 315b12b on kfll:swift-container-acl into e12b251 on pkgcloud:master.

@meteormatt
Copy link
Contributor

I have test it is OK.

Remove headers:

client.removeContainerHeaders(container, {
  'X-Remove-Container-Read': '.r:*'
}, function() {});

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.

None yet

3 participants