Feature request: built-in scheme for #tool to download an arbitrary HTTPS .zip file
#2,731 opened on 2020年3月12日
説明
Parameters
-
Version parameter: no. There would be no notion of the downloaded tool having a version, so no
versionorprereleaseparameters. -
Format parameter: maybe The format could be autodetected from the content type or file contents in case you eventually support archive formats other than .zip. There probably wouldn't be a need for a
type/formatparameter but it might be desirable. -
Checksum parameter: I want this. Even if the download is over HTTPS, it's nice to know if something else starts getting served. This would make HTTP/FTP URLs safe too. If the checksum is missing, Cake could download the file and then include the checksum in an error message requiring the checksum to be present in the .cake file.
Since query parameters in the same URL would collide with the URL to use for the download whether or not they are excluded when downloading, there would need to be a new way to handle this.
Proposal
#tool download: followed by a URL. If the URL contains a comma, it must be URL-encoded.
A parameter may be specified no more than once. Some parameters are required. To specify a parameter, add a comma to the end of the line followed by the parameter name, an equals sign, and a parameter value. If the parameter value contains a double quote character or comma, the whole parameter value must be double-quoted.
Valid parameter names:
checksum: Required. Value must start withSHA256:and the remainder must be 32 hex characters, case-insensitive. Future checksums may be supported.
#tool download:http://static.wixtoolset.org/releases/v3.14.0.3910/wix314-binaries.zip, checksum=SHA256:0904A88A4BCD9DD3C2274CAABE73989CD72767EE90C8FA0BF813D004EEC90D32
Questions
-
Is a
formatparameter desirable even if multiple formats become supported? -
Should there be support for the
filescheme or absolute or relative or Windows UNC paths? -
Should
checksumbe allowed to be omitted for HTTPS downloads? What about HTTP/FTP/file schemes?