Interface CorsPolicyProvider


public interface CorsPolicyProvider
A CorsPolicyProvider allows the CorsFilter to lookup its configuration at runtime, also based on contextual information.

It is the responsibility of the implementation to guarantee that the returned CorsPolicy match the provided origin.

  • Method Summary

    Modifier and Type
    Method
    Description
    findApplicable(Context context, String origin)
    Returns an optional CORS policy applicable in this context, for the given origin.
  • Method Details

    • findApplicable

      Optional<CorsPolicy> findApplicable(Context context, String origin)
      Returns an optional CORS policy applicable in this context, for the given origin.

      If the implementation cannot make a choice if multiple policies would be applicable, it is expected to log a message and return an empty Optional.

      Parameters:
      context - Runtime context (never null)
      origin - Origin header value (never null)
      Returns:
      an optional policy that can be applied to the origin, or empty.