1
0
mirror of https://github.com/fafhrd91/actix-web synced 2025-09-02 09:36:39 +02:00

fix scope and resource middleware data access (#2288)

This commit is contained in:
Rob Ede
2021-06-25 13:19:42 +01:00
committed by GitHub
parent 5a480d1d78
commit 539697292a
6 changed files with 136 additions and 81 deletions

View File

@@ -43,13 +43,14 @@ impl App<AppEntry, Body> {
/// Create application builder. Application can be configured with a builder-like pattern.
#[allow(clippy::new_without_default)]
pub fn new() -> Self {
let fref = Rc::new(RefCell::new(None));
let factory_ref = Rc::new(RefCell::new(None));
App {
endpoint: AppEntry::new(fref.clone()),
endpoint: AppEntry::new(factory_ref.clone()),
data_factories: Vec::new(),
services: Vec::new(),
default: None,
factory_ref: fref,
factory_ref,
external: Vec::new(),
extensions: Extensions::new(),
_phantom: PhantomData,