Documentation
¶
Index ¶
- func AllowedReferer(referer string, AllowedReferer []string) bool
- func HasExtension(path string, FileExtensions []string) bool
- func IgnoreHost(Host string, IgnoreHosts []string) bool
- type RejectHotlinkType
- func (hdlr *RejectHotlinkType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, ...) (err error)
- func (hdlr *RejectHotlinkType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, ...) (err error)
- func (hdlr *RejectHotlinkType) ServeHTTP(www http.ResponseWriter, req *http.Request)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AllowedReferer ¶
func HasExtension ¶
func IgnoreHost ¶
Types ¶
type RejectHotlinkType ¶
type RejectHotlinkType struct { Next http.Handler // Paths []string // Usually for this paths include all, so just set to "/", or maybee /js/, /css/, /image/ AllowedReferer []string // www.example.com, example.com etc. FileExtensions []string // Set of file extenstions to apply this to, ".js", ".gif", ".jpg", ".png" - not normally to .html AlloweEmpty string // IgnoreHosts []string // These hosts are completely ignored by this -- i.e. "localhost", "127.0.0.1" - useful for testing ReturnError string // if false, "no" - then return a file - usually empty. LineNo int // // contains filtered or unexported fields }
func NewRejectHotLinkServer ¶
func NewRejectHotLinkServer(n http.Handler, p []string, all []string, ext []string) *RejectHotlinkType
func NewRejectPathServer(n http.Handler, p []string) *RejectHotlinkType {
func (*RejectHotlinkType) InitializeWithConfigData ¶
func (hdlr *RejectHotlinkType) InitializeWithConfigData(next http.Handler, gCfg *cfg.ServerGlobalConfigType, serverName string, pNo, callNo int) (err error)
func (*RejectHotlinkType) PreValidate ¶
func (hdlr *RejectHotlinkType) PreValidate(gCfg *cfg.ServerGlobalConfigType, cfgData map[string]interface{}, serverName string, pNo, callNo int) (err error)
func (*RejectHotlinkType) ServeHTTP ¶
func (hdlr *RejectHotlinkType) ServeHTTP(www http.ResponseWriter, req *http.Request)
Click to show internal directories.
Click to hide internal directories.