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:
parent
4775242756
commit
1461118639
1 changed files with 17 additions and 2 deletions
|
@ -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())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue