We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ebeac26 commit c88785eCopy full SHA for c88785e
src/config/server.rs
@@ -109,7 +109,7 @@ impl Server {
109
/// - `FORCE_UNCONDITIONAL_REDIRECTS`: Whether to force unconditional redirects in the download
110
/// endpoint even with a healthy database pool.
111
/// - `BLOCKED_ROUTES`: A comma separated list of HTTP route patterns that are manually blocked
112
- /// by an operator (e.g. `/crates/:crate_id/:version/download`).
+ /// by an operator (e.g. `/crates/{crate_id}/{version}/download`).
113
///
114
/// # Panics
115
src/controllers/metrics.rs
@@ -6,7 +6,7 @@ use http::request::Parts;
6
use http::{header, StatusCode};
7
use prometheus::TextEncoder;
8
9
-/// Handles the `GET /api/private/metrics/:kind` endpoint.
+/// Handles the `GET /api/private/metrics/{kind}` endpoint.
10
pub async fn prometheus(app: AppState, Path(kind): Path<String>, req: Parts) -> AppResult<String> {
11
if let Some(expected_token) = &app.config.metrics_authorization_token {
12
let provided_token = req
src/middleware/cargo_compat.rs
@@ -75,11 +75,11 @@ pub async fn middleware(
75
fn is_cargo_endpoint(method: &Method, path: &str) -> bool {
76
const CARGO_ENDPOINTS: &[(Method, &str)] = &[
77
(Method::PUT, "/api/v1/crates/new"),
78
- (Method::DELETE, "/api/v1/crates/:crate_id/:version/yank"),
79
- (Method::PUT, "/api/v1/crates/:crate_id/:version/unyank"),
80
- (Method::GET, "/api/v1/crates/:crate_id/owners"),
81
- (Method::PUT, "/api/v1/crates/:crate_id/owners"),
82
- (Method::DELETE, "/api/v1/crates/:crate_id/owners"),
+ (Method::DELETE, "/api/v1/crates/{crate_id}/{version}/yank"),
+ (Method::PUT, "/api/v1/crates/{crate_id}/{version}/unyank"),
+ (Method::GET, "/api/v1/crates/{crate_id}/owners"),
+ (Method::PUT, "/api/v1/crates/{crate_id}/owners"),
+ (Method::DELETE, "/api/v1/crates/{crate_id}/owners"),
83
(Method::GET, "/api/v1/crates"),
84
];
85
src/router.rs
@@ -91,7 +91,7 @@ pub fn build_axum_router(state: AppState) -> Router<()> {
91
92
let mut router = router
93
// Metrics
94
- .route("/api/private/metrics/:kind", get(metrics::prometheus))
+ .route("/api/private/metrics/{kind}", get(metrics::prometheus))
95
// Alerts from GitHub scanning for exposed API tokens
96
.route(
97
"/api/github/secret-scanning/verify",
src/tests/blocked_routes.rs
@@ -32,7 +32,7 @@ async fn test_blocked_download_route() {
32
config.blocked_routes.clear();
33
config
34
.blocked_routes
35
- .insert("/api/v1/crates/:name/:version/download".into());
+ .insert("/api/v1/crates/{name}/{version}/download".into());
36
})
37
.with_user()
38
.await;
src/tests/routes/crates/owners/add.rs
@@ -7,7 +7,7 @@ use insta::assert_snapshot;
// This is testing Cargo functionality! ! !
// specifically functions modify_owners and add_owners
-// which call the `PUT /crates/:crate_id/owners` route
+// which call the `PUT /crates/{crate_id}/owners` route
#[tokio::test(flavor = "multi_thread")]
async fn test_cargo_invite_owners() {
13
let (app, _, owner) = TestApp::init().with_user().await;
src/tests/routes/users/read.rs
@@ -32,7 +32,7 @@ async fn show_latest_user_case_insensitively() {
// available for anyone to take. We need to support having multiple user accounts
// with the same gh_login in crates.io. `gh_id` is stable across renames, so that field
// should be used for uniquely identifying GitHub accounts whenever possible. For the
- // crates.io/user/:username pages, the best we can do is show the last crates.io account
+ // crates.io/user/{username} pages, the best we can do is show the last crates.io account
// created with that username.
let user1 = NewUser::new(
src/tests/user.rs
@@ -134,7 +134,7 @@ async fn github_with_email_does_not_overwrite_email() -> anyhow::Result<()> {
134
}
135
136
/// Given a crates.io user, check that the user's email can be
137
-/// updated in the database (PUT /user/:user_id), then check
+/// updated in the database (PUT /user/{user_id}), then check
138
/// that the updated email is sent back to the user (GET /me).
139
140
async fn test_email_get_and_put() -> anyhow::Result<()> {
@@ -155,7 +155,7 @@ async fn test_email_get_and_put() -> anyhow::Result<()> {
155
156
/// Given a new user, test that their email can be added
157
/// to the email table and a token for the email is generated
158
-/// and added to the token table. When /confirm/:email_token is
+/// and added to the token table. When /confirm/{email_token} is
159
/// requested, check that the response back is ok, and that
160
/// the email_verified field on user is now set to true.
161
0 commit comments