Documente la crate pmoapp
This commit is contained in:
@@ -316,10 +316,7 @@ impl DeviceInstance {
|
||||
return StatusCode::INTERNAL_SERVER_ERROR.into_response();
|
||||
}
|
||||
|
||||
let mut xml = String::from_utf8_lossy(&xml_output).to_string();
|
||||
|
||||
// Ajouter l'en-tête XML
|
||||
xml.insert_str(0, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
||||
let xml = String::from_utf8_lossy(&xml_output).to_string();
|
||||
|
||||
(
|
||||
StatusCode::OK,
|
||||
|
||||
@@ -112,10 +112,7 @@ pub trait UpnpObject: Clone + Debug {
|
||||
elem.write_with_config(&mut buf, config)
|
||||
.expect("Failed to write XML");
|
||||
|
||||
let mut xml_string = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".to_string();
|
||||
xml_string.push_str(&String::from_utf8(buf).expect("Invalid UTF-8"));
|
||||
|
||||
xml_string
|
||||
String::from_utf8(buf).expect("Invalid UTF-8")
|
||||
}
|
||||
|
||||
/// Convertit l'objet en représentation Markdown.
|
||||
|
||||
@@ -447,10 +447,7 @@ impl Service {
|
||||
elem.write_with_config(&mut buf, config)
|
||||
.expect("Failed to write XML");
|
||||
|
||||
let mut xml_string = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n".to_string();
|
||||
xml_string.push_str(&String::from_utf8(buf).expect("Invalid UTF-8"));
|
||||
|
||||
xml_string
|
||||
String::from_utf8(buf).expect("Invalid UTF-8")
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -395,11 +395,8 @@ impl ServiceInstance {
|
||||
return StatusCode::INTERNAL_SERVER_ERROR.into_response();
|
||||
}
|
||||
|
||||
let mut xml = String::from_utf8_lossy(&xml_output).to_string();
|
||||
|
||||
// Ajouter l'en-tête XML
|
||||
xml.insert_str(0, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
|
||||
|
||||
let xml = String::from_utf8_lossy(&xml_output).to_string();
|
||||
|
||||
(
|
||||
StatusCode::OK,
|
||||
[(axum::http::header::CONTENT_TYPE, "text/xml; charset=\"utf-8\"")],
|
||||
|
||||
Reference in New Issue
Block a user