Documentation
¶
Index ¶
Constants ¶
View Source
const ( ModCors = "mod_cors" HeaderAccessControlAllowOrigin = "Access-Control-Allow-Origin" HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials" HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods" HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers" HeaderAccessControlMaxAge = "Access-Control-Max-Age" HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers" HeaderAccessControlRequestMethod = "Access-Control-Request-Method" HeaderOrigin = "Origin" HeaderVary = "Vary" )
Variables ¶
This section is empty.
Functions ¶
func CorsRuleCheck ¶
func CorsRuleCheck(corsRuleFile *CorsRuleFile) error
Types ¶
type ConfModCors ¶
type ConfModCors struct {
Basic struct {
DataPath string // path of rule data
}
Log struct {
OpenDebug bool
}
}
func (*ConfModCors) Check ¶
func (cfg *ConfModCors) Check(confRoot string) error
type CorsRuleConf ¶
type CorsRuleConf struct {
Version string
Config ProductRuleList // product -> rule list
}
func CorsRuleFileLoad ¶
func CorsRuleFileLoad(filename string) (*CorsRuleConf, error)
type CorsRuleFile ¶
type CorsRuleFile struct {
Version string
Config ProductRuleRawList // product -> raw rule list
}
type CorsRuleList ¶
type CorsRuleList []CorsRule
type CorsRuleRaw ¶
type CorsRuleRaw struct {
Cond string // condition
// AccessControlAllowOrigins specifies either a single origin, which tells browsers to
// allow that origin to access the resource; or else — for requests without credentials —
// the "*" wildcard, to tell browsers to allow any origin to access the resource
AccessControlAllowOrigins []string
// AccessControlAllowCredentials Indicates whether or not the response to the request can be exposed
AccessControlAllowCredentials bool
// AccessControlExposeHeaders lets a server whitelist headers that browsers are allowed to access.
AccessControlExposeHeaders []string
// AccessControlAllowMethods specifies the method or methods allowed when accessing the resource.
// This is used in response to a preflight request.
AccessControlAllowMethods []string
// AccessControlAllowHeaders indicates which HTTP headers can be used when making the actual request.
// This is used in response to a preflight request.
AccessControlAllowHeaders []string
// AccessControlMaxAge indicates how long the results of a preflight request can be cached.
// This is used in response to a preflight request.
AccessControlMaxAge *int
}
type CorsRuleTable ¶
type CorsRuleTable struct {
// contains filtered or unexported fields
}
func NewCorsRuleTable ¶
func NewCorsRuleTable() *CorsRuleTable
func (*CorsRuleTable) Search ¶
func (t *CorsRuleTable) Search(product string) (CorsRuleList, bool)
func (*CorsRuleTable) Update ¶
func (t *CorsRuleTable) Update(ruleConf *CorsRuleConf)
type ModuleCors ¶
type ModuleCors struct {
// contains filtered or unexported fields
}
func NewModuleCors ¶
func NewModuleCors() *ModuleCors
func (*ModuleCors) Init ¶
func (m *ModuleCors) Init(cbs *bfe_module.BfeCallbacks, whs *web_monitor.WebHandlers, cr string) error
func (*ModuleCors) Name ¶
func (m *ModuleCors) Name() string
type ModuleCorsState ¶
type ProductRuleList ¶
type ProductRuleList map[string]CorsRuleList // product => list of cors rule list
type ProductRuleRawList ¶
type ProductRuleRawList map[string]RuleRawList // product => raw rule list
type RuleRawList ¶
type RuleRawList []CorsRuleRaw
Click to show internal directories.
Click to hide internal directories.