MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / list_mods

Function list_mods

mserver/MasterService/src/http.rs:331–346  ·  view source on GitHub ↗
(
    State(state): State<AppState>,
    headers: HeaderMap,
    Query(query): Query<ListModsQuery>,
)

Source from the content-addressed store, hash-verified

329 headers: HeaderMap,
330 Path(server_id): Path<String>,
331) -> Result<Json<ServerDetail>, StatusCode> {
332 match state
333 .service
334 .get_server_detail(&server_id)
335 .await
336 .map_err(|_| StatusCode::INTERNAL_SERVER_ERROR)?
337 {
338 Some(mut detail) => {
339 let base = request_base_url(&headers);
340 for mod_ref in &mut detail.mods {
341 absolutize_download_url(&mut mod_ref.download_url, base.as_deref());
342 }
343 Ok(Json(detail))
344 }
345 None => Err(StatusCode::NOT_FOUND),
346 }
347}
348
349#[utoipa::path(

Callers

nothing calls this directly

Calls 4

internal_errorFunction · 0.85
request_base_urlFunction · 0.85
absolutize_download_urlFunction · 0.85
list_modsMethod · 0.45

Tested by

no test coverage detected