v0.14.15-fix
This commit is contained in:
@@ -27,7 +27,7 @@ async fn export_configuration(
|
||||
|
||||
fn validate_configuration_header(export: &ConfigurationExport) -> Result<(), AppError> {
|
||||
if export.format_version != 3 {
|
||||
return Err(AppError::BadRequest("unsupported configuration export version; version 3 is required by GREE Controller 0.14.14".into()));
|
||||
return Err(AppError::BadRequest("unsupported configuration export version; version 3 is required by GREE Controller 0.14.15".into()));
|
||||
}
|
||||
if export.settings.control_strategy != "setpoint" {
|
||||
return Err(AppError::BadRequest(
|
||||
|
||||
@@ -2,6 +2,7 @@ async fn security_headers(request: Request, next: Next) -> Response {
|
||||
let path = request.uri().path();
|
||||
let is_api = path == "/api" || path.starts_with("/api/");
|
||||
let is_api_docs = path == "/api-docs" || path.starts_with("/api-docs/");
|
||||
let is_custom_chart = path.starts_with("/charts/custom/");
|
||||
|
||||
let mut response = next.run(request).await;
|
||||
|
||||
@@ -24,7 +25,7 @@ async fn security_headers(request: Request, next: Next) -> Response {
|
||||
);
|
||||
headers.insert(
|
||||
header::HeaderName::from_static("referrer-policy"),
|
||||
HeaderValue::from_static(if path.starts_with("/charts/custom/") {
|
||||
HeaderValue::from_static(if is_custom_chart {
|
||||
"no-referrer"
|
||||
} else {
|
||||
"same-origin"
|
||||
|
||||
@@ -15,6 +15,7 @@ struct SystemInfoResponse {
|
||||
simulator_count: usize,
|
||||
bind: String,
|
||||
base_path: String,
|
||||
public_chart_base_url: String,
|
||||
gree_interface: String,
|
||||
gree_received_frames: u64,
|
||||
gree_received_frames_by_device: std::collections::HashMap<String, u64>,
|
||||
@@ -191,6 +192,7 @@ fn build_system_info(state: &AppState, devices: &[Device]) -> SystemInfoResponse
|
||||
} else {
|
||||
state.config.base_path.clone()
|
||||
},
|
||||
public_chart_base_url: state.config.public_chart_base_url.clone(),
|
||||
gree_interface: if state.config.gree_interface.trim().is_empty() {
|
||||
"auto".to_string()
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user