Skip to content

Commit 4e27fd9

Browse files
committed
progress
1 parent 4f3a33c commit 4e27fd9

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

src/controllers/version/docs.rs

+17-18
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
//! Endpoint for triggering a docs.rs rebuild
22
3-
use super::update::authenticate;
43
use super::CrateVersionPath;
4+
use super::update::authenticate;
55
use crate::app::AppState;
6-
use crate::controllers::helpers::ok_true;
76
use crate::rate_limiter::LimitedAction;
8-
use crate::util::errors::{forbidden, AppResult};
7+
use crate::util::HeaderMapExt;
8+
use crate::util::errors::{AppResult, forbidden};
9+
use axum::body::Body;
910
use axum::response::Response;
11+
use http::HeaderValue;
1012
use http::request::Parts;
1113

1214
/// Trigger a rebuild for the crate documentation on docs.rs.
@@ -52,20 +54,17 @@ pub async fn rebuild_version_docs(
5254
.send()
5355
.await?;
5456

55-
let status= = response.status();
56-
57-
// reqwest::
58-
59-
// perform_version_yank_update(
60-
// &state,
61-
// &mut conn,
62-
// &mut version,
63-
// &krate,
64-
// &auth,
65-
// Some(yanked),
66-
// None,
67-
// )
68-
// .await?;
57+
const APPLICATION_JSON: HeaderValue = HeaderValue::from_static("application/json");
6958

70-
ok_true()
59+
Ok(Response::builder()
60+
.status(response.status())
61+
.header(
62+
"content-type",
63+
response
64+
.headers()
65+
.get("content-type")
66+
.unwrap_or(&APPLICATION_JSON),
67+
)
68+
.body(Body::from_stream(response.bytes_stream()))
69+
.unwrap())
7170
}

0 commit comments

Comments
 (0)