Struct actix_cors::Cors
source · pub struct Cors { /* private fields */ }
Expand description
Builder for CORS middleware.
+Struct actix_cors::Cors
source · pub struct Cors { /* private fields */ }
Expand description
Builder for CORS middleware.
To construct a CORS middleware, call Cors::default()
to create a blank, restrictive builder.
Then use any of the builder methods to customize CORS behavior.
The alternative Defaults to A server initialization error will occur if credentials are allowed, but the Origin is set
to send wildcards (Cors::permissive()
constructor is available for local development, allowing
@@ -103,10 +103,10 @@ the Fetch Standard C
false
.*
); this is not allowed by the CORS protocol.
sourcepub fn allow_local_network_access(self) -> Cors
pub fn allow_local_network_access(self) -> Cors
Allow private network access.
-If true, injects the Access-Control-Allow-Local-Network: true
header in responses if the
-request contained the Access-Control-Request-Local-Network: true
header.
For more information on this behavior, see the draft [Local Network Access] spec.
+sourcepub fn allow_private_network_access(self) -> Cors
pub fn allow_private_network_access(self) -> Cors
Allow private network access.
+If true, injects the Access-Control-Allow-Private-Network: true
header in responses if the
+request contained the Access-Control-Request-Private-Network: true
header.
For more information on this behavior, see the draft Private Network Access spec.
Defaults to false
.
sourcepub fn disable_vary_header(self) -> Cors
pub fn disable_vary_header(self) -> Cors
Disable Vary
header support.
When enabled the header Vary: Origin
will be returned as per the Fetch Standard
diff --git a/help.html b/help.html
index 99e84e117..178f910ad 100644
--- a/help.html
+++ b/help.html
@@ -1 +1 @@
-
Rustdoc help
BackRustdoc help
BackAccess-Control-Request-Headers
has an …","Request header Access-Control-Request-Method
has an …","Builder for CORS middleware.","Errors that can occur when processing CORS guarded …","One or more request headers are not allowed.","Request method is not allowed.","Request header Origin
is required but was not provided.","Request header Access-Control-Request-Method
is required …","Origin is not allowed to make this request.","Allowed origin argument must not be wildcard (*
).","Resets allowed request header list to a state where any …","Resets allowed methods list to all methods.","Resets allowed origin list to a state where any origin is …","Allow private network access.","Add an allowed request header.","Set a list of request header field names which can be used …","Set a list of methods which allowed origins can perform.","Add an origin that is allowed to make requests.","Determinate allowed origins by processing requests which …","Configures whether requests should be pre-emptively …","","","","","","","A restrictive (security paranoid) set of defaults.","Disable support for preflight requests.","Disable Vary
header support.","","Resets exposed response header list to a state where all …","Set a list of headers which are safe to expose to the API …","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self)
.","Calls U::from(self)
.","Set a maximum time (in seconds) for which this CORS …","","A very permissive set of default for quick development. …","","Set to use wildcard origins.","","Allows users to make authenticated requests","","","","","","","","","",""],"i":[8,8,0,0,8,8,8,8,8,8,1,1,1,1,1,1,1,1,1,1,1,8,1,8,8,8,1,1,1,8,1,1,1,8,8,1,8,1,8,1,1,1,8,1,8,1,8,8,1,8,1,8,1,8,1,8],"f":[0,0,0,0,0,0,0,0,0,0,[1,1],[1,1],[1,1],[1,1],[[1,[3,[2]]],1],[[1,4],1],[[1,4],1],[[1,5],1],[[1,6],1],[[1,7],1],[[]],[[]],[[]],[[]],[8,8],[[]],[[],1],[1,1],[1,1],[8,9],[1,1],[[1,4],1],[[1,10],11],[[8,10],11],[[8,10],11],[[]],[[]],[[]],[[]],[[1,[14,[[13,[12]]]]],1],[[1,[16,[15]]]],[[],1],[17],[1,1],[8,18],[1,1],[[]],[[],19],[[],20],[[],20],[[],20],[[],20],[[],21],[[],21],[[]],[[]]],"c":[],"p":[[3,"Cors"],[3,"HeaderName"],[8,"TryInto"],[8,"IntoIterator"],[15,"str"],[8,"Fn"],[15,"bool"],[4,"CorsError"],[3,"HttpResponse"],[3,"Formatter"],[6,"Result"],[15,"usize"],[4,"Option"],[8,"Into"],[3,"ServiceRequest"],[8,"Service"],[3,"Demand"],[3,"StatusCode"],[3,"String"],[4,"Result"],[3,"TypeId"]]},\
+"actix_cors":{"doc":"Cross-Origin Resource Sharing (CORS) controls for Actix …","t":"NNDENNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["BadRequestHeaders","BadRequestMethod","Cors","CorsError","HeadersNotAllowed","MethodNotAllowed","MissingOrigin","MissingRequestMethod","OriginNotAllowed","WildcardOrigin","allow_any_header","allow_any_method","allow_any_origin","allow_private_network_access","allowed_header","allowed_headers","allowed_methods","allowed_origin","allowed_origin_fn","block_on_origin_mismatch","borrow","borrow","borrow_mut","borrow_mut","clone","clone_into","default","disable_preflight","disable_vary_header","error_response","expose_any_header","expose_headers","fmt","fmt","fmt","from","from","into","into","max_age","new_transform","permissive","provide","send_wildcard","status_code","supports_credentials","to_owned","to_string","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip"],"q":[[0,"actix_cors"]],"d":["Request header Access-Control-Request-Headers
has an …","Request header Access-Control-Request-Method
has an …","Builder for CORS middleware.","Errors that can occur when processing CORS guarded …","One or more request headers are not allowed.","Request method is not allowed.","Request header Origin
is required but was not provided.","Request header Access-Control-Request-Method
is required …","Origin is not allowed to make this request.","Allowed origin argument must not be wildcard (*
).","Resets allowed request header list to a state where any …","Resets allowed methods list to all methods.","Resets allowed origin list to a state where any origin is …","Allow private network access.","Add an allowed request header.","Set a list of request header field names which can be used …","Set a list of methods which allowed origins can perform.","Add an origin that is allowed to make requests.","Determinate allowed origins by processing requests which …","Configures whether requests should be pre-emptively …","","","","","","","A restrictive (security paranoid) set of defaults.","Disable support for preflight requests.","Disable Vary
header support.","","Resets exposed response header list to a state where all …","Set a list of headers which are safe to expose to the API …","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self)
.","Calls U::from(self)
.","Set a maximum time (in seconds) for which this CORS …","","A very permissive set of default for quick development. …","","Set to use wildcard origins.","","Allows users to make authenticated requests","","","","","","","","","",""],"i":[8,8,0,0,8,8,8,8,8,8,1,1,1,1,1,1,1,1,1,1,1,8,1,8,8,8,1,1,1,8,1,1,1,8,8,1,8,1,8,1,1,1,8,1,8,1,8,8,1,8,1,8,1,8,1,8],"f":[0,0,0,0,0,0,0,0,0,0,[1,1],[1,1],[1,1],[1,1],[[1,[3,[2]]],1],[[1,4],1],[[1,4],1],[[1,5],1],[[1,6],1],[[1,7],1],[[]],[[]],[[]],[[]],[8,8],[[]],[[],1],[1,1],[1,1],[8,9],[1,1],[[1,4],1],[[1,10],11],[[8,10],11],[[8,10],11],[[]],[[]],[[]],[[]],[[1,[14,[[13,[12]]]]],1],[[1,[16,[15]]]],[[],1],[17],[1,1],[8,18],[1,1],[[]],[[],19],[[],20],[[],20],[[],20],[[],20],[[],21],[[],21],[[]],[[]]],"c":[],"p":[[3,"Cors"],[3,"HeaderName"],[8,"TryInto"],[8,"IntoIterator"],[15,"str"],[8,"Fn"],[15,"bool"],[4,"CorsError"],[3,"HttpResponse"],[3,"Formatter"],[6,"Result"],[15,"usize"],[4,"Option"],[8,"Into"],[3,"ServiceRequest"],[8,"Service"],[3,"Demand"],[3,"StatusCode"],[3,"String"],[4,"Result"],[3,"TypeId"]]},\
"actix_identity":{"doc":"Identity management for Actix Web.","t":"DIDLLLLLLLALALLLKLLLLLLLLLLLLLLLNDENLLLLLLLLLLLLLLLLLLLLLLLLLLLLEDDNDNDNNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["Identity","IdentityExt","IdentityMiddleware","borrow","borrow","borrow_mut","borrow_mut","builder","clone","clone_into","config","default","error","from","from","from_request","get_identity","id","into","into","login","logout","new_transform","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","vzip","vzip","DeleteIdentityKeys","IdentityMiddlewareBuilder","LogoutBehaviour","PurgeSession","borrow","borrow","borrow_mut","borrow_mut","build","clone","clone","clone_into","clone_into","fmt","fmt","from","from","into","into","login_deadline","logout_behaviour","to_owned","to_owned","try_from","try_from","try_into","try_into","type_id","type_id","visit_deadline","vzip","vzip","GetIdentityError","LoginError","LostIdentityError","LostIdentityError","MissingIdentityError","MissingIdentityError","SessionExpiryError","SessionExpiryError","SessionGetError","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","into","into","into","into","into","provide","provide","provide","provide","provide","source","source","status_code","status_code","to_string","to_string","to_string","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip"],"q":[[0,"actix_identity"],[32,"actix_identity::config"],[64,"actix_identity::error"]],"d":["A verified user identity. It can be used as a request …","Helper trait to retrieve an Identity
instance from various …","Identity management middleware.","","","","","A fluent API to configure IdentityMiddleware
.","","","Configuration options to tune the behaviour of …","","Failure modes of identity operations.","Returns the argument unchanged.","Returns the argument unchanged.","","Retrieve the identity attached to the current session, if …","Return the user id associated to the current session.","Calls U::from(self)
.","Calls U::from(self)
.","Attach a valid user identity to the current session.","Remove the user identity from the current session.","","","","","","","","","","","When Identity::logout
is called, remove the identity …","A fluent builder to construct an IdentityMiddleware
…","LogoutBehaviour
controls what actions are going to be …","When Identity::logout
is called, purge the current session.","","","","","Finalises the builder and returns an IdentityMiddleware
…","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self)
.","Calls U::from(self)
.","Automatically logs out users after a certain amount of …","Determines how Identity::logout
affects the current …","","","","","","","","","Automatically logs out users after a certain amount of …","","","Errors that can occur while retrieving an identity.","Error that can occur during login attempts.","The identity information has been lost.","Identity info was lost after being validated.","There is no identity information attached to the current …","No identity is found in a session.","Error encountered when working with a session that has …","The session has expired.","Failed to accessing the session store.","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","Returns the argument unchanged.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,0,0,5,2,5,2,2,2,2,0,2,0,5,2,5,27,5,5,2,5,5,2,2,5,2,5,2,5,2,5,2,14,0,0,14,14,1,14,1,1,14,1,14,1,14,1,14,1,14,1,1,1,14,1,14,1,14,1,14,1,1,14,1,0,0,0,6,0,6,0,6,6,10,19,20,21,6,10,19,20,21,6,10,10,19,19,20,20,21,21,6,6,10,10,19,20,21,6,6,6,6,6,10,19,20,21,6,10,19,20,21,6,10,6,10,6,10,19,20,21,6,10,19,20,21,6,10,19,20,21,6,10,19,20,21,6,10,19,20,21,6],"f":[0,0,0,[[]],[[]],[[]],[[]],[[],1],[2,2],[[]],0,[[],2],0,[[]],[[]],[[3,4]],[[],[[7,[5,6]]]],[5,[[7,[8,6]]]],[[]],[[]],[[9,8],[[7,[5,10]]]],[5],[[2,[12,[11]]]],[[]],[[],7],[[],7],[[],7],[[],7],[[],13],[[],13],[[]],[[]],0,0,0,0,[[]],[[]],[[]],[[]],[1,2],[14,14],[1,1],[[]],[[]],[[14,15],16],[[1,15],16],[[]],[[]],[[]],[[]],[[1,[18,[17]]],1],[[1,14],1],[[]],[[]],[[],7],[[],7],[[],7],[[],7],[[],13],[[],13],[[1,[18,[17]]],1],[[]],[[]],0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[10,15],16],[[10,15],16],[[19,15],16],[[19,15],16],[[20,15],16],[[20,15],16],[[21,15],16],[[21,15],16],[[6,15],16],[[6,15],16],[[]],[22,10],[[]],[[]],[[]],[21,6],[23,6],[19,6],[20,6],[[]],[[]],[[]],[[]],[[]],[[]],[24],[24],[24],[24],[24],[10,[[18,[25]]]],[6,[[18,[25]]]],[10,26],[6,26],[[],8],[[],8],[[],8],[[],8],[[],8],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],7],[[],13],[[],13],[[],13],[[],13],[[],13],[[]],[[]],[[]],[[]],[[]]],"c":[],"p":[[3,"IdentityMiddlewareBuilder"],[3,"IdentityMiddleware"],[3,"HttpRequest"],[4,"Payload"],[3,"Identity"],[4,"GetIdentityError"],[4,"Result"],[3,"String"],[3,"Extensions"],[3,"LoginError"],[3,"ServiceRequest"],[8,"Service"],[3,"TypeId"],[4,"LogoutBehaviour"],[3,"Formatter"],[6,"Result"],[3,"Duration"],[4,"Option"],[3,"SessionExpiryError"],[3,"LostIdentityError"],[3,"MissingIdentityError"],[3,"SessionInsertError"],[3,"SessionGetError"],[3,"Demand"],[8,"Error"],[3,"StatusCode"],[8,"IdentityExt"]]},\
"actix_limitation":{"doc":"Rate limiter using a fixed window counter for arbitrary …","t":"DNRRRRENDNDDNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL","n":["Builder","Client","DEFAULT_COOKIE_NAME","DEFAULT_PERIOD_SECS","DEFAULT_REQUEST_LIMIT","DEFAULT_SESSION_KEY","Error","LimitExceeded","Limiter","Other","RateLimiter","Status","Time","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","builder","clone","clone","clone_into","clone_into","cookie_name","count","default","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","into","into","into","into","into","key_by","limit","limit","new_transform","period","provide","remaining","reset_epoch_utc","session_key","source","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip","vzip"],"q":[[0,"actix_limitation"]],"d":["Rate limiter builder.","Redis client failed to connect or run a query.","Default cookie name.","Default period (in seconds).","Default request limit.","Default session key.","Failure modes of the rate limiter.","Limit is exceeded for a key.","Rate limiter.","Generic error.","Rate limit middleware.","A report for a given key containing the limit status.","Time conversion failed.","","","","","","","","","","","Finalizes and returns a Limiter
.","Construct rate limiter builder with defaults.","","","","","Sets name of cookie to be sent.","Consumes one rate limit unit, returning the status.","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Sets rate limit key derivation function.","Set upper limit.","Returns the maximum number of requests allowed in the …","","Set limit window/period.","","Returns how many requests are left in the current period.","Returns a UNIX timestamp in UTC approximately when the …","Sets session key to be used in backend.","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[0,3,0,0,0,0,0,3,0,3,0,0,3,1,3,10,7,2,1,3,10,7,2,1,2,7,2,7,2,1,2,10,1,3,3,10,7,2,1,3,3,3,10,7,2,1,3,10,7,2,1,1,7,10,1,3,7,7,1,3,7,2,3,1,3,10,7,2,1,3,10,7,2,1,3,10,7,2,1,3,10,7,2],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[1,[[4,[2,3]]]],[[[6,[5]]],1],[7,7],[2,2],[[]],[[]],[[1,[6,[[9,[8]]]]],1],[[2,[6,[5]]],[[4,[7,3]]]],[[],10],[[1,11],12],[[3,11],12],[[3,11],12],[[10,11],12],[[7,11],12],[[2,11],12],[[]],[13,3],[[]],[14,3],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[1,[0,[15,16,17]]],1],[[1,18],1],[7,18],[[10,[20,[19]]]],[[1,21],1],[22],[7,18],[7,18],[[1,[6,[[9,[8]]]]],1],[3,[[24,[23]]]],[[]],[[]],[[],5],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],4],[[],25],[[],25],[[],25],[[],25],[[],25],[[]],[[]],[[]],[[]],[[]]],"c":[29,58],"p":[[3,"Builder"],[3,"Limiter"],[4,"Error"],[4,"Result"],[3,"String"],[8,"Into"],[3,"Status"],[15,"str"],[4,"Cow"],[3,"RateLimiter"],[3,"Formatter"],[6,"Result"],[3,"ComponentRange"],[3,"RedisError"],[8,"Fn"],[8,"Send"],[8,"Sync"],[15,"usize"],[3,"ServiceRequest"],[8,"Service"],[3,"Duration"],[3,"Demand"],[8,"Error"],[4,"Option"],[3,"TypeId"]]},\
"actix_protobuf":{"doc":"Protobuf payload extractor for Actix Web.","t":"NNNNDDDEINLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLL","n":["ContentType","Deserialize","Overflow","Payload","ProtoBuf","ProtoBufConfig","ProtoBufMessage","ProtoBufPayloadError","ProtoBufResponseBuilder","Serialize","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","default","deref","deref_mut","error_response","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from_request","into","into","into","into","into_future","limit","limit","new","poll","protobuf","resource_path","respond_to","to_string","to_string","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_poll","type_id","type_id","type_id","type_id","vzip","vzip","vzip","vzip"],"q":[[0,"actix_protobuf"]],"d":["Content type error","Deserialize error","Payload size is bigger than 256k","Payload error","","","","","","Serialize error","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","Calls U::from(self)
.","","Change max size of payload. By default max size is 256Kb","Change max size of payload. By default max size is 256Kb","Create ProtoBufMessage
for request.","","","","","","","","","","","","","","","","","","","","","","",""],"i":[4,4,4,4,0,0,0,0,0,4,3,1,16,4,3,1,16,4,1,3,3,4,3,3,4,4,3,1,16,4,4,4,3,3,1,16,4,16,1,16,16,16,25,3,3,3,4,3,1,16,4,3,1,16,4,16,3,1,16,4,3,1,16,4],"f":[0,0,0,0,0,0,0,0,0,0,[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[]],[[],1],[[[3,[2]]],2],[[[3,[2]]],2],[4,5],[[[3,[[0,[6,2]]]],7],8],[[[3,[[0,[9,2]]]],7],8],[[4,7],8],[[4,7],8],[[]],[[]],[[]],[10,4],[11,4],[[]],[[12,13]],[[]],[[]],[[]],[[]],[[]],[[1,14],1],[[[16,[[0,[2,15]]]],14],[[16,[[0,[2,15]]]]]],[[12,13],[[16,[[0,[2,15]]]]]],[[[17,[[16,[[0,[2,15]]]]]],18],19],[2,[[21,[5,20]]]],[[],22],[[[3,[[0,[2,15]]]],12],5],[[],23],[[],23],[[],21],[[],21],[[],21],[[],21],[[],21],[[],21],[[],21],[[],21],[[17,18],19],[[],24],[[],24],[[],24],[[],24],[[]],[[]],[[]],[[]]],"c":[],"p":[[3,"ProtoBufConfig"],[8,"Message"],[3,"ProtoBuf"],[4,"ProtoBufPayloadError"],[3,"HttpResponse"],[8,"Debug"],[3,"Formatter"],[6,"Result"],[8,"Display"],[3,"DecodeError"],[4,"PayloadError"],[3,"HttpRequest"],[4,"Payload"],[15,"usize"],[8,"Default"],[3,"ProtoBufMessage"],[3,"Pin"],[3,"Context"],[4,"Poll"],[3,"Error"],[4,"Result"],[3,"Path"],[3,"String"],[3,"TypeId"],[8,"ProtoBufResponseBuilder"]]},\
diff --git a/settings.html b/settings.html
index 63646771b..9da1ec2f7 100644
--- a/settings.html
+++ b/settings.html
@@ -1 +1 @@
-