Skip to content

Commit 0b8fd79

Browse files
authored
Remove trailing slash from api URL
While trying to migrate the crates.io backend over to `hyper`, we ran into the issue that cargo hits API endpoints with URLs like `https://crates.io//api/v1/crates/new` (`//` before `api`). At the time, we rolled back the deploy and reverted the code in rust-lang/crates.io#1476 because it broke cargo API interactions. By removing the trailing `/` in the configuration here, cargo clients will send a single `/` and we won't need special case handling on the backend. I've looked though the history of `src/crates-io/lib.rs` in the `cargo` source, and as far back as rust-lang/cargo@9fba127 the code always appends `/api/v1` the the configured api URL. This is included in the oldest git tag for cargo, `v0.0.1-pre`.
1 parent b089a0e commit 0b8fd79

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
{
22
"dl": "https://crates.io/api/v1/crates",
3-
"api": "https://crates.io/"
3+
"api": "https://crates.io"
44
}

0 commit comments

Comments
 (0)