{"action":"created","issue":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/937","labels_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/937/labels{/name}","comments_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/937/comments","events_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/937/events","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/937","id":116227812,"number":937,"title":"CORS","user":{"login":"MKHenson","id":2727104,"avatar_url":"https://avatars.githubusercontent.com/u/2727104?v=3","gravatar_id":"","url":"https://api.github.com/users/MKHenson","html_url":"https://github.com/MKHenson","followers_url":"https://api.github.com/users/MKHenson/followers","following_url":"https://api.github.com/users/MKHenson/following{/other_user}","gists_url":"https://api.github.com/users/MKHenson/gists{/gist_id}","starred_url":"https://api.github.com/users/MKHenson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MKHenson/subscriptions","organizations_url":"https://api.github.com/users/MKHenson/orgs","repos_url":"https://api.github.com/users/MKHenson/repos","events_url":"https://api.github.com/users/MKHenson/events{/privacy}","received_events_url":"https://api.github.com/users/MKHenson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-10T23:38:41Z","updated_at":"2015-11-11T20:03:29Z","closed_at":"2015-11-11T20:03:29Z","body":"Hi guys\r\n\r\nIs there a way for us to set the CORS properties of the buckets via the node API? If so, are there any examples?\r\n\r\nThanks"},"comment":{"url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/comments/155895523","html_url":"https://github.com/GoogleCloudPlatform/gcloud-node/issues/937#issuecomment-155895523","issue_url":"https://api.github.com/repos/GoogleCloudPlatform/gcloud-node/issues/937","id":155895523,"user":{"login":"stephenplusplus","id":723048,"avatar_url":"https://avatars.githubusercontent.com/u/723048?v=3","gravatar_id":"","url":"https://api.github.com/users/stephenplusplus","html_url":"https://github.com/stephenplusplus","followers_url":"https://api.github.com/users/stephenplusplus/followers","following_url":"https://api.github.com/users/stephenplusplus/following{/other_user}","gists_url":"https://api.github.com/users/stephenplusplus/gists{/gist_id}","starred_url":"https://api.github.com/users/stephenplusplus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/stephenplusplus/subscriptions","organizations_url":"https://api.github.com/users/stephenplusplus/orgs","repos_url":"https://api.github.com/users/stephenplusplus/repos","events_url":"https://api.github.com/users/stephenplusplus/events{/privacy}","received_events_url":"https://api.github.com/users/stephenplusplus/received_events","type":"User","site_admin":false},"created_at":"2015-11-11T20:03:29Z","updated_at":"2015-11-11T20:03:29Z","body":"You can! See [`bucket#setMetadata`](https://googlecloudplatform.github.io/gcloud-node/#/docs/v0.24.1/storage/bucket?method=setMetadata). The `metadata` argument accepts everything documented [here](https://cloud.google.com/storage/docs/json_api/v1/buckets/patch).\r\n\r\n```js\r\nbucket.setMetadata({\r\n  cors: [\r\n    {\r\n      origin: ['http://example.appspot.com'],\r\n      responseHeader: ['Content-Type'],\r\n      method: ['GET', 'HEAD', 'DELETE'],\r\n      maxAgeSeconds: 3600\r\n    }\r\n  ]\r\n}, function(err) {});\r\n```\r\n\r\nLet me know if you run into any issues."}}