Implement GetProtocolInfo
This commit is contained in:
parent
0303cfa084
commit
99ffeec323
2 changed files with 20 additions and 3 deletions
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0"?>
|
||||
<s:Envelope
|
||||
xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"
|
||||
s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
|
||||
<s:Body>
|
||||
<u:GetProtocolInfoResponse xmlns:u="urn:schemas-upnp-org:service:ConnectionManager:1">
|
||||
<Source>http-get:*:*:DLNA.ORG_OP=01</Source>
|
||||
<Sink></Sink>
|
||||
</u:GetProtocolInfoResponse>
|
||||
</s:Body>
|
||||
</s:Envelope>
|
||||
|
|
@ -1,9 +1,11 @@
|
|||
use axum::{body::Bytes, extract::State, response::IntoResponse};
|
||||
use bstr::BStr;
|
||||
use http::{HeaderMap, StatusCode};
|
||||
use http::{header::CONTENT_TYPE, HeaderMap, StatusCode};
|
||||
use tracing::{debug, trace};
|
||||
|
||||
use crate::{state::UnpnServerState, subscriptions::SubscribeRequest};
|
||||
use crate::{
|
||||
constants::CONTENT_TYPE_XML_UTF8, state::UnpnServerState, subscriptions::SubscribeRequest,
|
||||
};
|
||||
|
||||
pub const SOAP_ACTION_GET_PROTOCOL_INFO: &[u8] =
|
||||
b"\"urn:schemas-upnp-org:service:ConnectionManager:1#GetProtocolInfo\"";
|
||||
|
|
@ -39,7 +41,11 @@ pub(crate) async fn http_handler(
|
|||
let not_implemented = StatusCode::NOT_IMPLEMENTED.into_response();
|
||||
|
||||
match action.as_ref() {
|
||||
SOAP_ACTION_GET_PROTOCOL_INFO => not_implemented,
|
||||
SOAP_ACTION_GET_PROTOCOL_INFO => (
|
||||
[(CONTENT_TYPE, CONTENT_TYPE_XML_UTF8)],
|
||||
include_str!("../resources/templates/connection_manager/control/get_protocol_info.xml"),
|
||||
)
|
||||
.into_response(),
|
||||
SOAP_ACTION_CONNECTION_COMPLETE => not_implemented,
|
||||
SOAP_ACTION_GET_CURRENT_CONNECTION_INFO => not_implemented,
|
||||
SOAP_ACTION_GET_CURRENT_CONNECTION_IDS => not_implemented,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue