Skip to content

Commit

Permalink
use Context.insert
Browse files Browse the repository at this point in the history
removes a few redundant lines
  • Loading branch information
calebbourg committed Nov 7, 2024
1 parent c05cd3e commit c9dd4ff
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions rama-http/src/layer/proxy_auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use crate::header::PROXY_AUTHENTICATE;
use crate::headers::{authorization::Credentials, HeaderMapExt, ProxyAuthorization};
use crate::{Request, Response, StatusCode};
use rama_core::{context::Extensions, Context, Layer, Service};
use rama_core::{Context, Layer, Service};
use rama_net::user::{auth::Authority, UserId};
use rama_utils::macros::define_inner_service_accessors;
use std::fmt;
Expand Down Expand Up @@ -197,9 +197,7 @@ where
.unwrap())
}
} else if self.allow_anonymous {
let mut user_ext = Extensions::new();
user_ext.insert(UserId::Anonymous);
ctx.extend(user_ext);
ctx.insert(UserId::Anonymous);

self.inner.serve(ctx, req).await
} else {
Expand Down

0 comments on commit c9dd4ff

Please sign in to comment.