Enum rocket_cors::Error
source · pub enum Error {
MissingOrigin,
BadOrigin(ParseError),
MissingRequestMethod,
BadRequestMethod,
MissingRequestHeaders,
OriginNotAllowed,
MethodNotAllowed,
HeadersNotAllowed,
CredentialsWithWildcardOrigin,
MissingCorsInRocketState,
MissingInjectedHeader,
}
Expand description
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.
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
Origin is not allowed to make this request
MethodNotAllowed
Requested method is not allowed
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
sourceimpl Error for Error
impl Error for Error
sourcefn description(&self) -> &str
fn description(&self) -> &str
sourcefn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
Auto Trait Implementations
impl RefUnwindSafe for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnwindSafe for Error
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> IntoCollection<T> for T
impl<T> IntoCollection<T> for T
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
fn into_collection<A>(self) -> SmallVec<A>where
A: Array<Item = T>,
self
into a collection.