Auto merge of #4836 - sfackler:dl-template, r=withoutboats
authorbors <bors@rust-lang.org>
Tue, 19 Dec 2017 01:48:52 +0000 (01:48 +0000)
committerbors <bors@rust-lang.org>
Tue, 19 Dec 2017 01:48:52 +0000 (01:48 +0000)
Template a registry's dl field

Previously, crate files were always downloaded from
`/{crate}/{version}/download`. However, if the backing crate store for a
custom registry is a raw file server rather than an API endpoint that
requires every file to be named `download` which is a bit weird. Now a
registry's dl URL can be templated with `{crate}` and `{version}` to
have more control over the resulting path.

For backwards compatibility, we append the default template suffix onto
the dl URL if neither of the template parameters are present for
backwards compatibility.

r? @alexcrichton

cc @withoutboats


Trivial merge