Optional publish static files if use reverse-proxy

O01eg
Jan 25, 2022, 1:17 PM
7R6HAATP4CKWKNOFWAVCZFJVF6LADPHHIINR37PYNGAWGCTBJSJQC

Dependencies

Change contents

  • edit in src/main.rs at line 1
    [3.17]
    [3.0]
    #[cfg(feature = "actix-files")]
  • edit in src/main.rs at line 39
    [3.737]
    [3.737]
    #[cfg(feature = "actix-files")]
  • edit in src/main.rs at line 41
    [3.779]
    [3.779]
    #[cfg(not(feature = "actix-files"))]
    let Config { http } = config;
  • replacement in src/main.rs at line 53
    [3.810][3.810:829]()
    App::new()
    [3.810]
    [3.829]
    let app = App::new()
  • replacement in src/main.rs at line 59
    [3.703][3.151:234](),[3.912][3.151:234](),[3.234][3.912:1279](),[3.912][3.912:1279](),[3.1279][3.1155:1209]()
    .service(web::resource("/login.do").route(web::post().to(login_post)))
    // Serve a tree of static files at the web root and specify the index file.
    // Note that the root path should always be defined as the last item. The paths are
    // resolved in the order they are defined. If this would be placed before the `/images`
    // path then the service for the static images would never be reached.
    .service(Files::new("/static/", &public))
    [3.703]
    [3.1351]
    .service(web::resource("/login.do").route(web::post().to(login_post)));
    // Serve a tree of static files at the web root and specify the index file.
    // Note that the root path should always be defined as the last item. The paths are
    // resolved in the order they are defined. If this would be placed before the `/images`
    // path then the service for the static images would never be reached.
    #[cfg(feature = "actix-files")]
    let app = app.service(Files::new("/static/", &public));
    app
  • edit in src/config.rs at line 10
    [3.1583]
    [3.1583]
    #[cfg(feature = "actix-files")]
  • edit in Cargo.toml at line 6
    [2.17]
    [3.287]
    resolver = "2"
    [features]
    non-proxied = ["actix-files"]
  • replacement in Cargo.toml at line 17
    [3.8450][3.8450:8479]()
    actix-files = "0.6.0-beta.2"
    [3.8450]
    [3.1377]
    actix-files = { version = "0.6.0-beta.2", optional = true }
  • replacement in Cargo.lock at line 746
    [3.24897][2.1749:1769]()
    version = "0.2.113"
    [3.24897]
    [3.8299]
    version = "0.2.114"
  • replacement in Cargo.lock at line 748
    [3.8364][2.1770:1848]()
    checksum = "eef78b64d87775463c549fbd80e19249ef436ea3bf1de2a1eb7e717ec7fab1e9"
    [3.8364]
    [3.8442]
    checksum = "b0005d08a8f7b65fb8073cb697aa0b12b631ed251ce73d862ce50eeb52ce3b50"