java.lang.Object
i2p.susi.webmail.CSPDetector

class CSPDetectorextends Object
Detects Content Security Policy support in user agent strings.
  • Constructor Details

    • CSPDetector

      CSPDetector()
      Create a detector; all methods are static, so no instance state is needed.
  • Method Details

    • supportsCSP

      public static boolean supportsCSP(String ua)
      Parameters:
      ua - the user agent string
      Returns:
      true if supported
    • getVersion

      private static int getVersion(String ua, int idx)
      Reads the run of digits starting at idx in the user-agent string.
      Parameters:
      ua - the user-agent string
      idx - where to start reading
      Returns:
      the number, or 0 if the character at idx is not a digit