proper mime type
This commit is contained in:
@@ -1,11 +1,16 @@
|
||||
use crate::state::AppState;
|
||||
use axum::extract::State;
|
||||
use axum::{extract::State, http::HeaderMap, response::IntoResponse};
|
||||
use reqwest::header;
|
||||
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;
|
||||
|
||||
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 {
|
||||
|
Reference in New Issue
Block a user