proper mime type
All checks were successful
CI/CD Pipeline / test (push) Successful in 1m21s
CI/CD Pipeline / deploy (push) Successful in 1m12s

This commit is contained in:
Philipp Hofer
2025-10-13 09:14:01 +02:00
parent 0bea48475b
commit 82fe5e3485

View File

@@ -1,11 +1,16 @@
use crate::state::AppState; use crate::state::AppState;
use axum::extract::State; use axum::{extract::State, http::HeaderMap, response::IntoResponse};
use reqwest::header;
use std::sync::Arc; use std::sync::Arc;
pub async fn stream_handler(State(state): State<Arc<AppState>>) -> String { pub async fn stream_handler(State(state): State<Arc<AppState>>) -> impl IntoResponse {
state.clone().check_update().await; state.clone().check_update().await;
feed(&state.urls.read().await.to_vec()) let content = feed(&state.urls.read().await.to_vec());
let mut headers = HeaderMap::new();
headers.insert(header::CONTENT_TYPE, "application/rss+xml".parse().unwrap());
(headers, content)
} }
fn feed(urls: &Vec<String>) -> String { fn feed(urls: &Vec<String>) -> String {