Interface AllowedOrigin

All Superinterfaces:
Serializable

public interface AllowedOrigin extends Serializable
Represents a host-source, as specified by the Content Security Policy specification.

Instead of path, path-abempty is used.

  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    boolean
    matches(Origin origin, URL protectedResourceUrl)
    Test whether A URL url is said to match a host-source expression for a protected resource.
     
  • Method Details

    • isOrigin

      boolean isOrigin()
      Returns:
      true if this AllowedOrigin instance can be converted to a Origin.
      See Also:
    • toOrigin

      Origin toOrigin()
      Returns:
      convert this AllowedOrigin to a simple Origin. Check first if this is possible with the isOrigin() method.
    • matches

      boolean matches(Origin origin, URL protectedResourceUrl)
      Test whether A URL url is said to match a host-source expression for a protected resource.

      Note: no path-part matching is supported in this method.

      Parameters:
      origin - origin to test
      protectedResourceUrl - url of the protected resource, that publishes the host-source
      Returns:
      true when the url matches