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 ba0cb0a commit 2c6252eCopy full SHA for 2c6252e
terragrunt/modules/crates-io/cloudfront-functions/static-router.js
@@ -7,5 +7,15 @@ function handler(event) {
7
request.uri = request.uri.replace("+", "%2B");
8
}
9
10
+ // cargo versions before 1.24 don't support placeholders in the `dl` field
11
+ // of the index, so we need to rewrite the download URL to point to the
12
+ // crate file instead.
13
+ var match = request.uri.match(/^\/crates\/([^\/]+)\/([^\/]+)\/download$/);
14
+ if (match) {
15
+ var crate = match[1];
16
+ var version = match[2];
17
+ request.uri = `/crates/${crate}/${crate}-${version}.crate`;
18
+ }
19
+
20
return request;
21
0 commit comments