Documentation ¶
Index ¶
Constants ¶
View Source
const ( //AppTopLevelDomainTemplate matches when host top level domain == origin top level domain (abc.com == abc.com) AppTopLevelDomainTemplate = "{{APP_TLD}}" //AppSecondLevelDomainTemplate matches any origin domain if host top level domain == origin top level domain (app.abc.com == noapp.abc.com) AppSecondLevelDomainTemplate = "*.{{APP_TLD}}" )
Variables ¶
This section is empty.
Functions ¶
func ExtractTopLevelAndDomain ¶
ExtractTopLevelAndDomain returns top level domain and domain e.g. abc.efg.com returns "efg.com", "abc"
Types ¶
type AppDomainRule ¶
type AppDomainRule struct {
// contains filtered or unexported fields
}
AppDomainRule replaced AppTopLevelDomainTemplate with input HOST header and uses PrefixSuffixRule
func (*AppDomainRule) IsAllowed ¶
func (adr *AppDomainRule) IsAllowed(host, reqOrigin string) bool
IsAllowed returns true if reqOrigin matches the rule
type PrefixSuffixRule ¶
type PrefixSuffixRule struct {
// contains filtered or unexported fields
}
PrefixSuffixRule checks domain by prefix abc* and suffix: *.abc.com
func (*PrefixSuffixRule) IsAllowed ¶
func (psr *PrefixSuffixRule) IsAllowed(host, reqOrigin string) bool
IsAllowed returns true if reqOrigin matches the rule
type Rule ¶
Rule is a CORS rule
func NewPrefixSuffixRule ¶
NewPrefixSuffixRule returns PrefixSuffixRule
Click to show internal directories.
Click to hide internal directories.