Escape XML instead of CDATA. Samsung TVs only understand escapes, but not CDATA.
This commit is contained in:
parent
79a8451519
commit
65623f2074
2 changed files with 12 additions and 6 deletions
|
|
@ -2,11 +2,7 @@
|
||||||
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
||||||
<s:Body>
|
<s:Body>
|
||||||
<u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
|
<u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1">
|
||||||
<Result><![CDATA[<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
|
<Result>{items_encoded}</Result>
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
|
|
||||||
{items}
|
|
||||||
</DIDL-Lite>]]></Result>
|
|
||||||
<NumberReturned>{number_returned}</NumberReturned>
|
<NumberReturned>{number_returned}</NumberReturned>
|
||||||
<TotalMatches>{total_matches}</TotalMatches>
|
<TotalMatches>{total_matches}</TotalMatches>
|
||||||
<UpdateID>{update_id}</UpdateID>
|
<UpdateID>{update_id}</UpdateID>
|
||||||
|
|
|
||||||
|
|
@ -135,11 +135,21 @@ pub mod browse {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn render_response(envelope: &Envelope<'_>) -> String {
|
fn render_response(envelope: &Envelope<'_>) -> String {
|
||||||
|
let items_encoded = format!(
|
||||||
|
r#"<DIDL-Lite xmlns="urn:schemas-upnp-org:metadata-1-0/DIDL-Lite/"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||||
|
xmlns:upnp="urn:schemas-upnp-org:metadata-1-0/upnp/">
|
||||||
|
{items}
|
||||||
|
</DIDL-Lite>"#,
|
||||||
|
items = envelope.items
|
||||||
|
);
|
||||||
|
let items_encoded = quick_xml::escape::escape(items_encoded.as_ref());
|
||||||
|
|
||||||
format!(
|
format!(
|
||||||
include_str!(
|
include_str!(
|
||||||
"../resources/templates/content_directory/control/browse/response.tmpl.xml"
|
"../resources/templates/content_directory/control/browse/response.tmpl.xml"
|
||||||
),
|
),
|
||||||
items = envelope.items,
|
items_encoded = items_encoded,
|
||||||
number_returned = envelope.number_returned,
|
number_returned = envelope.number_returned,
|
||||||
total_matches = envelope.total_matches,
|
total_matches = envelope.total_matches,
|
||||||
update_id = envelope.update_id
|
update_id = envelope.update_id
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue