Skip to content

Commit 022c9ec

Browse files
committed
revert change to to_response
1 parent 4221d5f commit 022c9ec

File tree

1 file changed

+2
-13
lines changed

1 file changed

+2
-13
lines changed

site/src/server.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -731,18 +731,14 @@ fn verify_gh_sig(cfg: &Config, header: &str, body: &[u8]) -> Option<bool> {
731731
Some(false)
732732
}
733733

734-
fn to_response_with_content_type<S>(
735-
result: ServerResult<S>,
736-
content_type: ContentType,
737-
compression: &Option<BrotliEncoderParams>,
738-
) -> Response
734+
fn to_response<S>(result: ServerResult<S>, compression: &Option<BrotliEncoderParams>) -> Response
739735
where
740736
S: Serialize,
741737
{
742738
match result {
743739
Ok(result) => {
744740
let response = http::Response::builder()
745-
.header_typed(content_type)
741+
.header_typed(ContentType::octet_stream())
746742
.header_typed(CacheControl::new().with_no_cache().with_no_store());
747743
let body = rmp_serde::to_vec_named(&result).unwrap();
748744
maybe_compressed_response(response, body, compression)
@@ -756,13 +752,6 @@ where
756752
}
757753
}
758754

759-
fn to_response<S>(result: ServerResult<S>, compression: &Option<BrotliEncoderParams>) -> Response
760-
where
761-
S: Serialize,
762-
{
763-
to_response_with_content_type(result, ContentType::octet_stream(), compression)
764-
}
765-
766755
pub fn maybe_compressed_response(
767756
response: http::response::Builder,
768757
body: Vec<u8>,

0 commit comments

Comments
 (0)