Documentation
¶
Index ¶
- Constants
- func CheckCorrectAcceptEncodingCheck(r *http.Request) bool
- func CheckSecCHDeviceMemoryequalto8(r *http.Request) bool
- func IsDevtoolsPath(r *http.Request) bool
- func ValidateClientHintWindowsPlatformVersion(platform string, platformVersion string) bool
- type HeaderChecker
- func (HeaderChecker) CaddyModule() caddy.ModuleInfo
- func (h HeaderChecker) DeterminUnRealisticHeaderCount(r *http.Request) bool
- func (h *HeaderChecker) Provision(ctx caddy.Context) error
- func (h HeaderChecker) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
- func (h *HeaderChecker) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
- func (h HeaderChecker) ValidateSecChUaPlatformLinux(r *http.Request) bool
Constants ¶
const DevtoolsPath = "/.well-known/appspecific/com.chrome.devtools.json"
Variables ¶
This section is empty.
Functions ¶
func CheckSecCHDeviceMemoryequalto8 ¶
memSetNot8 returns true if Sec-CH-Device-Memory is present and not "8".
func IsDevtoolsPath ¶
func ValidateClientHintWindowsPlatformVersion ¶
ValidateClientHintWindowsPlatformVersion returns true if either: - platform is not Windows (no check on version), we need to research how to validate other parts - platform is Windows AND version is exactly "19.0.0".
Returns false if platform is Windows but version is missing/incorrect.
Types ¶
type HeaderChecker ¶
type HeaderChecker struct {
// contains filtered or unexported fields
}
HeaderChecker checks various UA-related headers and compares their versions.
func (HeaderChecker) CaddyModule ¶
func (HeaderChecker) CaddyModule() caddy.ModuleInfo
CaddyModule returns the Caddy module information.
func (HeaderChecker) DeterminUnRealisticHeaderCount ¶
func (h HeaderChecker) DeterminUnRealisticHeaderCount(r *http.Request) bool
func (HeaderChecker) ServeHTTP ¶
func (h HeaderChecker) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddyhttp.Handler) error
ServeHTTP inspects the headers and then calls the next handler.
func (*HeaderChecker) UnmarshalCaddyfile ¶
func (h *HeaderChecker) UnmarshalCaddyfile(d *caddyfile.Dispenser) error
func (HeaderChecker) ValidateSecChUaPlatformLinux ¶
func (h HeaderChecker) ValidateSecChUaPlatformLinux(r *http.Request) bool
The following function checks if there is a wrong implementation based on the fact that Linux has a hard implementation of X11; Linux x86_64