1
0
Fork 0
mirror of https://github.com/zhaofengli/attic.git synced 2024-12-14 11:57:30 +00:00

fix application/x-nix-nar Content-Type not being applied

Signed-off-by: strawberry <strawberry@puppygock.gay>
This commit is contained in:
strawberry 2024-12-05 22:15:38 -05:00
parent 4775242756
commit 1461118639
No known key found for this signature in database

View file

@ -9,6 +9,7 @@ use std::io::{Error as IoError, ErrorKind as IoErrorKind};
use std::path::PathBuf;
use std::sync::Arc;
use axum::http;
use axum::{
body::Body,
extract::{Extension, Path},
@ -223,7 +224,14 @@ async fn get_nar(
});
let body = Body::from_stream(stream);
Ok(body.into_response())
Ok((
[(
http::header::CONTENT_TYPE,
http::HeaderValue::from_static(mime::NAR),
)],
body,
)
.into_response())
}
}
} else {
@ -260,7 +268,14 @@ async fn get_nar(
});
let body = Body::from_stream(merged);
Ok(body.into_response())
Ok((
[(
http::header::CONTENT_TYPE,
http::HeaderValue::from_static(mime::NAR),
)],
body,
)
.into_response())
}
}