pub struct CorsHeaders {
pub allowed_origins: Arc<Vec<String>>,
}Expand description
Adds the same CORS envelope JSS emits from its global onRequest hook.
When allowed_origins is non-empty, the Access-Control-Allow-Origin
header is only reflected for origins in the list; requests from other
origins receive no ACAO header. When the list is empty (default), the
request Origin is echoed back (wildcard-equivalent, suitable for local dev).
Fields§
§allowed_origins: Arc<Vec<String>>Trait Implementations§
Source§impl<S, B> Transform<S, ServiceRequest> for CorsHeaderswhere
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
B: 'static,
impl<S, B> Transform<S, ServiceRequest> for CorsHeaderswhere
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error> + 'static,
B: 'static,
Source§type Response = ServiceResponse<B>
type Response = ServiceResponse<B>
Responses produced by the service.
Source§type Transform = CorsHeadersMiddleware<S>
type Transform = CorsHeadersMiddleware<S>
The
TransformService value created by this factorySource§type Future = Ready<Result<<CorsHeaders as Transform<S, ServiceRequest>>::Transform, <CorsHeaders as Transform<S, ServiceRequest>>::InitError>>
type Future = Ready<Result<<CorsHeaders as Transform<S, ServiceRequest>>::Transform, <CorsHeaders as Transform<S, ServiceRequest>>::InitError>>
The future response value.
Source§fn new_transform(&self, service: S) -> Self::Future
fn new_transform(&self, service: S) -> Self::Future
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations§
impl Freeze for CorsHeaders
impl RefUnwindSafe for CorsHeaders
impl Send for CorsHeaders
impl Sync for CorsHeaders
impl Unpin for CorsHeaders
impl UnsafeUnpin for CorsHeaders
impl UnwindSafe for CorsHeaders
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more