@Nullable
    public CorsPolicy getPolicy(@Nullable String origin, RoutingContext routingContext) {
        requireNonNull(routingContext, "routingContext");
        if (origin == null) {
            return null;
        }

        if (isAnyOriginSupported()) {
            return Iterables.getFirst(policies, null);
        }

        final String lowerCaseOrigin = Ascii.toLowerCase(origin);
        final boolean isNullOrigin = CorsHeaderUtil.NULL_ORIGIN.equals(lowerCaseOrigin);
        for (final CorsPolicy policy : policies) {
            if (isNullOrigin && policy.isNullOriginAllowed() &&
                isPathMatched(policy, routingContext)) {
                return policy;
            } else if (!isNullOrigin && isPathMatched(policy, routingContext)) {
                if (policy.originPredicate().test(lowerCaseOrigin)) {
                    return policy;
                }
            }
        }
        return null;
    }
Returns the policy for the specified {@code origin}.

@return {@link CorsPolicy} which allows the {@code origin},
        {@code null} if the {@code origin} is {@code null} or not allowed in any policy.
core/src/main/java/com/linecorp/armeria/server/cors/CorsConfig.java