Skip to content

CORS #937

Description

@MKHenson

Hi guys

Is there a way for us to set the CORS properties of the buckets via the node API? If so, are there any examples?

Thanks

Activity

  1. stephenplusplus commented on Nov 11, 2015

    @stephenplusplus
    Contributor

    You can! See bucket#setMetadata. The metadata argument accepts everything documented here.

    bucket.setMetadata({
      cors: [
        {
          origin: ['http://example.appspot.com'],
          responseHeader: ['Content-Type'],
          method: ['GET', 'HEAD', 'DELETE'],
          maxAgeSeconds: 3600
        }
      ]
    }, function(err) {});

    Let me know if you run into any issues.

  2. added
    type: questionRequest for information or clarification. Not an issue.
    api: storageIssues related to the Cloud Storage API.
    on Nov 11, 2015
  3. bedeoverend commented on Mar 6, 2017

    @bedeoverend

    @daslicht don't know if you already solved this one. But on the image you're loading into the canvas, are you setting crossOrigin = 'Anonymous'? That might help. See https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_enabled_image

  4. daslicht commented on Mar 6, 2017

    @daslicht

    @bedeoverend yeah , already solved :) Thank you very much !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

api: storageIssues related to the Cloud Storage API.type: questionRequest for information or clarification. Not an issue.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions