Class AWS::S3::CORSRule
In: lib/aws/s3/cors_rule.rb
Parent: Object

Represents a single CORS rule for an S3 {Bucket}.

@example

  rule = bucket.cors.first
  rule.allowed_methods #=> ['GET', 'HEAD']
  rule.allowed_origins #=> ['*']

@see CORSRuleCollection

Methods

new   to_h  

Attributes

allowed_headers  [R]  @return [Array<String>] A list of headers allowed in the pre-flight
  OPTIONS request.
allowed_methods  [R]  @return [Array<String>] A list of HTTP methods (GET, POST, etc) this
  role authorizes.
allowed_origins  [R]  @return [Array<String>] The list of origins allowed to make
  cross-domain requests to the bucket.
expose_headers  [R]  @return [Array<String>] The headers that may be accessed cross-domain.
id  [R]  @return [String,nil] A user supplied unique identifier for this role.
  Set this when you set or add roles via {CORSRuleCollection}.
max_age_seconds  [R]  @return [Integer,nil] The time in seconds the browser may cache the
  pre-flight response.

Public Class methods

@param [Hash] options A hash of the rule details.

@option options [String] :id A unique identifier for the rule. The ID

  value can be up to 255 characters long. The IDs help you find
  a rule in the configuration.

@option options [required,Array<String>] :allowed_methods A list of HTTP

  methods that you want to allow the origin to execute.
  Each rule must identify at least one method.

@option options [required,Array<String>] :allowed_origins A list of

  origins you want to allow cross-domain requests from. This can
  contain at most one * wild character.

@option options [Array<String>] :allowed_headers A list of headers

  allowed in a pre-flight OPTIONS request via the
  Access-Control-Request-Headers header. Each header name
  specified in the Access-Control-Request-Headers header must
  have a corresponding entry in the rule.

  Amazon S3 will send only the allowed headers in a response
  that were requested. This can contain at most one '*' wild
  character.

@option options [Array<String>] :max_age_seconds The time in

  seconds that your browser is to cache the pre-flight response for
  the specified resource.

@option options [Array<String>] :expose_headers One or more headers in

   the response that you want customers to be able to access
   from their applications (for example, from a JavaScript
   XMLHttpRequest object).

Public Instance methods

@return [Hash]

[Validate]