docs: fix example in ctx.md

fix check_beta_user function parameter type
This commit is contained in:
Abdallah-Zidan 2024-03-28 19:34:03 +02:00 committed by GitHub
parent 0de54eb907
commit e9762fe95f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -14,7 +14,7 @@ pub struct MyCtx {
beta_user: bool,
}
fn check_beta_user(req: &pingora_http::RequestHeader) -> bool {
fn check_beta_user(req: &pingora::http::RequestHeader) -> bool {
// some simple logic to check if user is beta
req.headers.get("beta-flag").is_some()
}
@ -113,4 +113,4 @@ impl ProxyHttp for MyProxy {
The complete example can be found under [`pingora-proxy/examples/ctx.rs`](../../pingora-proxy/examples/ctx.rs). You can run it using `cargo`:
```
RUST_LOG=INFO cargo run --example ctx
```
```