Add contet-type to stream

This commit is contained in:
Ivan 2024-07-27 11:44:15 +02:00
parent 81755c55d2
commit a77c1caace
4 changed files with 59 additions and 0 deletions

View file

@ -167,6 +167,13 @@ impl HttpApi {
let mut output_headers = HeaderMap::new();
output_headers.insert("Accept-Ranges", HeaderValue::from_static("bytes"));
if let Ok(mime) = state.torrent_file_mime_type(idx, file_id) {
output_headers.insert(
http::header::CONTENT_TYPE,
HeaderValue::from_str(mime).context("bug - invalid MIME")?,
);
}
let range_header = headers.get(http::header::RANGE);
trace!(torrent_id=idx, file_id=file_id, range=?range_header, "request for HTTP stream");