mirror of
https://github.com/actix/actix-website
synced 2025-06-27 07:29:02 +02:00
Update virtual hosting example to use guard::Host instead of guard::Header (#318)
This commit is contained in:
committed by
GitHub
parent
5fa564fd4e
commit
77920d65fe
@ -7,12 +7,12 @@ async fn main() -> std::io::Result<()> {
|
||||
App::new()
|
||||
.service(
|
||||
web::scope("/")
|
||||
.guard(guard::Header("Host", "www.rust-lang.org"))
|
||||
.guard(guard::Host("www.rust-lang.org"))
|
||||
.route("", web::to(|| async { HttpResponse::Ok().body("www") })),
|
||||
)
|
||||
.service(
|
||||
web::scope("/")
|
||||
.guard(guard::Header("Host", "users.rust-lang.org"))
|
||||
.guard(guard::Host("users.rust-lang.org"))
|
||||
.route("", web::to(|| async { HttpResponse::Ok().body("user") })),
|
||||
)
|
||||
.route("/", web::to(HttpResponse::Ok))
|
||||
|
Reference in New Issue
Block a user