1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-23 15:51:06 +01:00

Update Cors function documentation to match behaviour (#289)

Co-authored-by: Rob Ede <robjtede@icloud.com>
This commit is contained in:
Marko Malenic 2022-09-21 19:15:54 +10:00 committed by GitHub
parent 1561bda822
commit d98ebf2bdf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -123,10 +123,10 @@ impl Cors {
/// Add an origin that is allowed to make requests. /// Add an origin that is allowed to make requests.
/// ///
/// By default, requests from all origins are accepted by CORS logic. This method allows to /// This method allows specifying a finite set of origins to verify the value of the `Origin`
/// specify a finite set of origins to verify the value of the `Origin` request header. /// request header. These are `origin-or-null` types in the [Fetch Standard].
/// ///
/// These are `origin-or-null` types in the [Fetch Standard]. /// By default, no origins are accepted.
/// ///
/// When this list is set, the client's `Origin` request header will be checked in a /// When this list is set, the client's `Origin` request header will be checked in a
/// case-sensitive manner. /// case-sensitive manner.
@ -211,7 +211,7 @@ impl Cors {
/// These will be sent in the `Access-Control-Allow-Methods` response header as specified in /// These will be sent in the `Access-Control-Allow-Methods` response header as specified in
/// the [Fetch Standard CORS protocol]. /// the [Fetch Standard CORS protocol].
/// ///
/// Defaults to `[GET, HEAD, POST, OPTIONS, PUT, PATCH, DELETE]` /// This defaults to an empty set.
/// ///
/// [Fetch Standard CORS protocol]: https://fetch.spec.whatwg.org/#http-cors-protocol /// [Fetch Standard CORS protocol]: https://fetch.spec.whatwg.org/#http-cors-protocol
pub fn allowed_methods<U, M>(mut self, methods: U) -> Cors pub fn allowed_methods<U, M>(mut self, methods: U) -> Cors
@ -283,7 +283,7 @@ impl Cors {
/// will be echoed back in the `Access-Control-Allow-Headers` header as specified in /// will be echoed back in the `Access-Control-Allow-Headers` header as specified in
/// the [Fetch Standard CORS protocol]. /// the [Fetch Standard CORS protocol].
/// ///
/// Defaults to `All`. /// This defaults to an empty set.
/// ///
/// [Fetch Standard CORS protocol]: https://fetch.spec.whatwg.org/#http-cors-protocol /// [Fetch Standard CORS protocol]: https://fetch.spec.whatwg.org/#http-cors-protocol
pub fn allowed_headers<U, H>(mut self, headers: U) -> Cors pub fn allowed_headers<U, H>(mut self, headers: U) -> Cors