Skip to content

Commit 2d18c1d

Browse files
committed
Remove essentially unused self_profile_raw::Response::is_tarball
It's always false, and we don't really need to worry about backwards compatibility with clients in the wild, so remove it.
1 parent 6e90882 commit 2d18c1d

File tree

2 files changed

+5
-13
lines changed

2 files changed

+5
-13
lines changed

site/src/api.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ pub mod self_profile_raw {
263263
pub cids: Vec<i32>,
264264
pub cid: i32,
265265
pub url: String,
266-
pub is_tarball: bool,
267266
}
268267
}
269268

site/src/request_handlers/self_profile.rs

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,8 @@ pub async fn handle_self_profile_raw_download(
390390
body: self_profile_raw::Request,
391391
ctxt: &SiteCtxt,
392392
) -> http::Response<hyper::Body> {
393-
let res = handle_self_profile_raw(body, ctxt).await;
394-
let (url, is_tarball) = match res {
395-
Ok(v) => (v.url, v.is_tarball),
393+
let url = match handle_self_profile_raw(body, ctxt).await {
394+
Ok(v) => v.url,
396395
Err(e) => {
397396
let mut resp = http::Response::new(e.into());
398397
*resp.status_mut() = StatusCode::BAD_REQUEST;
@@ -427,14 +426,9 @@ pub async fn handle_self_profile_raw_download(
427426
.insert(hyper::header::CONTENT_TYPE, header.pop().unwrap());
428427
server_resp.headers_mut().insert(
429428
hyper::header::CONTENT_DISPOSITION,
430-
hyper::header::HeaderValue::from_maybe_shared(format!(
431-
"attachment; filename=\"{}\"",
432-
if is_tarball {
433-
"self-profile.tar"
434-
} else {
435-
"self-profile.mm_profdata"
436-
}
437-
))
429+
hyper::header::HeaderValue::from_maybe_shared(
430+
"attachment; filename=\"self-profile.mm_profdata\"",
431+
)
438432
.expect("valid header"),
439433
);
440434
*server_resp.status_mut() = StatusCode::OK;
@@ -615,7 +609,6 @@ pub async fn handle_self_profile_raw(
615609
cids: cids.to_vec(),
616610
cid,
617611
url,
618-
is_tarball: false,
619612
})
620613
}
621614
}

0 commit comments

Comments
 (0)