Skip to content

Commit d1b122f

Browse files
authored
fix(maven): return escaped summary for project description (#5839)
* fix(maven): return escaped summary for project description * build: add quickxml to labrinth * fix(maven): use quickxml to escape xml special chars
1 parent 281bf06 commit d1b122f

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

apps/labrinth/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ murmur2 = { workspace = true }
8080
paste = { workspace = true }
8181
path-util = { workspace = true }
8282
prometheus = { workspace = true }
83+
quick-xml = { workspace = true }
8384
rand = { workspace = true }
8485
rand_chacha = { workspace = true }
8586
redis = { workspace = true, features = ["ahash", "r2d2", "tokio-comp"] }

apps/labrinth/src/routes/maven.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ use crate::queue::session::AuthQueue;
1313
use crate::routes::ApiError;
1414
use crate::{auth::get_user_from_headers, database};
1515
use actix_web::{HttpRequest, HttpResponse, get, route, web};
16+
use quick_xml::escape::escape;
1617
use std::collections::HashSet;
1718
use yaserde::YaSerialize;
1819

@@ -329,7 +330,7 @@ pub async fn version_file(
329330
artifact_id: project_id,
330331
version: vnum,
331332
name: project.inner.name,
332-
description: project.inner.description,
333+
description: escape(project.inner.summary).into_owned(),
333334
};
334335
return Ok(HttpResponse::Ok()
335336
.content_type("text/xml")

0 commit comments

Comments
 (0)