[][src]Enum rocket_cors::Error

pub enum Error {
    MissingOrigin,
    BadOrigin(ParseError),
    OpaqueAllowedOrigin(Vec<String>),
    MissingRequestMethod,
    BadRequestMethod,
    MissingRequestHeaders,
    OriginNotAllowed(String),
    MethodNotAllowed(String),
    RegexError(Error),
    HeadersNotAllowed,
    CredentialsWithWildcardOrigin,
    MissingCorsInRocketState,
    MissingInjectedHeader,
}

Errors during operations

This enum implements rocket::response::Responder which will return an appropriate status code while printing out the error in the console. Because these errors are usually the result of an error while trying to respond to a CORS request, CORS headers cannot be added to the response and your applications requesting CORS will not be able to see the status code.

Variants

MissingOrigin

The HTTP request header Origin is required but was not provided

BadOrigin(ParseError)

The HTTP request header Origin could not be parsed correctly.

OpaqueAllowedOrigin(Vec<String>)

The configured Allowed Origins are Opaque origins. Use a Regex instead.

MissingRequestMethod

The request header Access-Control-Request-Method is required but is missing

BadRequestMethod

The request header Access-Control-Request-Method has an invalid value

MissingRequestHeaders

The request header Access-Control-Request-Headers is required but is missing.

OriginNotAllowed(String)

Origin is not allowed to make this request

MethodNotAllowed(String)

Requested method is not allowed

RegexError(Error)

A regular expression compilation error

HeadersNotAllowed

One or more headers requested are not allowed

CredentialsWithWildcardOrigin

Credentials are allowed, but the Origin is set to "*". This is not allowed by W3C

This is a misconfiguration. Check the docuemntation for Cors.

MissingCorsInRocketState

A CORS Request Guard was used, but no CORS Options was available in Rocket's state

This is a misconfiguration. Use Rocket::manage to add a CORS options to managed state.

MissingInjectedHeader

The on_response handler of Fairing could not find the injected header from the Request. Either some other fairing has removed it, or this is a bug.

Trait Implementations

impl From<ParseError> for Error[src]

impl From<Error> for Error[src]

impl Display for Error[src]

impl Debug for Error[src]

impl Error for Error[src]

impl<'r> Responder<'r> for Error[src]

Auto Trait Implementations

impl Send for Error

impl Sync for Error

impl Unpin for Error

impl UnwindSafe for Error

impl RefUnwindSafe for Error

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Typeable for T where
    T: Any

impl<T> IntoCollection<T> for T

impl<T, I> AsResult<T, I> for T where
    I: Input,