java.lang.Object
i2p.susi.webmail.CSPDetector
Detects Content Security Policy support in user agent strings.
Constructor Summary
ConstructorsConstructorDescriptionCreate a detector; all methods are static, so no instance state is needed.Method Summary
Modifier and TypeMethodDescriptionprivate static intgetVersion(String ua, int idx) Reads the run of digits starting at idx in the user-agent string.static booleansupportsCSP(String ua) See also: Content-Security-Policy header
Constructor Details
CSPDetector
CSPDetector()Create a detector; all methods are static, so no instance state is needed.
Method Details
supportsCSP
See also: Content-Security-Policy header- Parameters:
ua- the user agent string- Returns:
- true if supported
getVersion
Reads the run of digits starting at idx in the user-agent string.- Parameters:
ua- the user-agent stringidx- where to start reading- Returns:
- the number, or 0 if the character at idx is not a digit