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)
commit77a773a4f78aed157613b37f0b18e3aea0d588f5
treeb8e3169d266ab9f16fe4f4dea59df5377af39c54
parent576ac63f5a919abe83d1c1f8008c54a20f8ee054
parent52f099b08456581967d7ba92c965ff4edb300f80
Auto merge of #4836 - sfackler:dl-template, r=withoutboats

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