You've already forked authentication-service
mirror of
https://github.com/matrix-org/matrix-authentication-service.git
synced 2025-07-29 22:01:14 +03:00
Remove code duplication across branches
This commit is contained in:
committed by
Quentin Gliech
parent
0e1b2ea6b1
commit
1aedabb6c6
@ -68,21 +68,16 @@ mod builtin {
|
||||
let len = asset.data.len().try_into().unwrap();
|
||||
let mime = mime_guess::from_path(path).first_or_octet_stream();
|
||||
|
||||
let headers = (
|
||||
TypedHeader(ContentType::from(mime)),
|
||||
TypedHeader(ContentLength(len)),
|
||||
TypedHeader(etag),
|
||||
);
|
||||
|
||||
let res = if is_head {
|
||||
(
|
||||
TypedHeader(ContentType::from(mime)),
|
||||
TypedHeader(ContentLength(len)),
|
||||
TypedHeader(etag),
|
||||
)
|
||||
.into_response()
|
||||
headers.into_response()
|
||||
} else {
|
||||
(
|
||||
TypedHeader(ContentType::from(mime)),
|
||||
TypedHeader(ContentLength(len)),
|
||||
TypedHeader(etag),
|
||||
asset.data,
|
||||
)
|
||||
.into_response()
|
||||
(headers, asset.data).into_response()
|
||||
};
|
||||
|
||||
Some(res)
|
||||
|
Reference in New Issue
Block a user