pdk-cors-lib 1.7.0

PDK CORS Library
Documentation
// Copyright (c) 2026, Salesforce, Inc.,
// All rights reserved.
// For full license text, see the LICENSE.txt file

#[derive(Debug, thiserror::Error)]
/// Possible errors that can arise while validating a specific requests against the configured
/// [`OriginGroup`](`super::OriginGroup`)
pub enum CorsError {
    /// The request method could not be found in the request.
    #[error("Unable to find a valid method for current request.")]
    RequestMethodNotFound,

    /// The request origin does not match with any allowed origin.
    #[error("Incoming request Origin does not match with any allowed Origin.")]
    OriginsDoesNotMatch,

    /// The request headers are not allowed for the current request.
    #[error("CORS Headers not allowed in incoming request")]
    HeaderNotAllowed,

    /// The request method is not allowed for the current request.
    #[error("CORS Method not allowed in incoming request")]
    MethodNotAllowed,
}