mirror of
https://github.com/rustfs/rustfs.git
synced 2026-01-17 01:30:33 +00:00
fix:add favicon.ico route (#713)
This commit is contained in:
@@ -237,7 +237,7 @@ pub(crate) fn init_telemetry(config: &OtelConfig) -> OtelGuard {
|
||||
match metrics_exporter_opentelemetry::Recorder::builder("order-service").install_global() {
|
||||
Ok(_) => {}
|
||||
Err(e) => {
|
||||
eprintln!("Failed to set global metrics recorder: {:?}", e);
|
||||
eprintln!("Failed to set global metrics recorder: {e:?}");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -387,7 +387,7 @@ fn get_console_config_from_env() -> (bool, u32, u64, String) {
|
||||
}
|
||||
|
||||
pub fn is_console_path(path: &str) -> bool {
|
||||
path.starts_with(CONSOLE_PREFIX)
|
||||
path == "/favicon.ico" || path.starts_with(CONSOLE_PREFIX)
|
||||
}
|
||||
|
||||
/// Setup comprehensive middleware stack with tower-http features
|
||||
@@ -398,6 +398,7 @@ fn setup_console_middleware_stack(
|
||||
auth_timeout: u64,
|
||||
) -> Router {
|
||||
let mut app = Router::new()
|
||||
.route("/favicon.ico", get(static_handler))
|
||||
.route(&format!("{CONSOLE_PREFIX}/license"), get(license_handler))
|
||||
.route(&format!("{CONSOLE_PREFIX}/config.json"), get(config_handler))
|
||||
.route(&format!("{CONSOLE_PREFIX}/health"), get(health_check))
|
||||
|
||||
@@ -31,7 +31,6 @@ use tower::Service;
|
||||
use tracing::error;
|
||||
|
||||
use crate::admin::ADMIN_PREFIX;
|
||||
use crate::admin::console::CONSOLE_PREFIX;
|
||||
use crate::admin::console::is_console_path;
|
||||
use crate::admin::console::make_console_server;
|
||||
use crate::admin::rpc::RPC_PREFIX;
|
||||
@@ -99,7 +98,7 @@ where
|
||||
}
|
||||
}
|
||||
|
||||
uri.path().starts_with(ADMIN_PREFIX) || uri.path().starts_with(RPC_PREFIX) || uri.path().starts_with(CONSOLE_PREFIX)
|
||||
uri.path().starts_with(ADMIN_PREFIX) || uri.path().starts_with(RPC_PREFIX) || is_console_path(uri.path())
|
||||
}
|
||||
|
||||
// check_access before call
|
||||
|
||||
Reference in New Issue
Block a user