Documentation
¶
Overview ¶
Package cors is a middleware that generates CORS headers for Flamego.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Options ¶
type Options struct {
// Scheme may be http or https as accepted schemes or the "*" wildcard to accept
// any scheme. Default is "http".
Scheme string
// AllowDomain is a comma separated list of domains that are allowed to initiate
// CORS requests. Special value is a single "*" wildcard that will allow any
// domain to send requests without credentials and the special "!*" wildcard
// which will reply with requesting domain in the "access-control-allow-origin"
// header and hence allow requests from any domain *with* credentials. Default
// is "*".
AllowDomain []string
// AllowSubdomain allowed subdomains of domains to run CORS requests. Default is
// false.
AllowSubdomain bool
// Methods may be a comma separated list of HTTP-methods to be accepted. Default
// is ["GET", "POST", "OPTIONS"].
Methods []string
// MaxAgeSeconds may be the duration in secs for which the response is cached.
// Default is 600 * time.Second.
MaxAge time.Duration
// AllowCredentials set to false rejects any request with credentials. Default
// is false.
AllowCredentials bool
}
Options contains options for the cors.CORS middleware.
Click to show internal directories.
Click to hide internal directories.