1
0
mirror of https://github.com/actix/actix-extras.git synced 2024-11-27 17:22:57 +01:00

CORS origin does not end with / (#291)

This commit is contained in:
Duy Do 2022-09-22 18:46:24 +07:00 committed by GitHub
parent a2c5cbd637
commit d28ab6eaa1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,7 +20,7 @@
//! async fn main() -> std::io::Result<()> { //! async fn main() -> std::io::Result<()> {
//! HttpServer::new(|| { //! HttpServer::new(|| {
//! let cors = Cors::default() //! let cors = Cors::default()
//! .allowed_origin("https://www.rust-lang.org/") //! .allowed_origin("https://www.rust-lang.org")
//! .allowed_origin_fn(|origin, _req_head| { //! .allowed_origin_fn(|origin, _req_head| {
//! origin.as_bytes().ends_with(b".rust-lang.org") //! origin.as_bytes().ends_with(b".rust-lang.org")
//! }) //! })