Send SOAP for GET /api/hello

This commit is contained in:
flyingscorpio@clevo 2023-01-08 14:47:20 +01:00
parent b2da1dcb6a
commit daa34863d5
2 changed files with 2 additions and 1 deletions

View file

@ -120,6 +120,7 @@ fn handle_request(request: Request, mut sender: Mouth) {
/// Handles a given GET request
fn handle_get_request(request: Request, mut sender: Mouth) {
match request.section.as_str() {
"hello" => sender.send_soap_xml(),
"titre" => match database::search_title_from_titre(&request.requested_data) {
Ok(result) => {
if result.is_empty() {

View file

@ -42,7 +42,7 @@ impl<'a> Mouth<'a> {
}
/// Send response data in SOAP XML to a client.
fn send_soap_xml(&mut self) {
pub fn send_soap_xml(&mut self) {
let status_code = Status::OK;
let contents = fs::read_to_string("soap/hello.xml").unwrap();
let length = contents.len();