@@ -120,6 +120,10 @@ func New(options *Options) *API {
120120 // types to get files.
121121 r .Get ("/assets/{publisher}/{extension}/{version}/{type}" , api .assetRedirect )
122122
123+ // This is the "download manually" URL, which like /assets is hardcoded and
124+ // ignores the VSIX asset URL provided to VS Code in the response.
125+ r .Get ("/publishers/{publisher}/vsextensions/{extension}/{version}/{type}" , api .assetRedirect )
126+
123127 return api
124128}
125129
@@ -200,10 +204,14 @@ func (api *API) extensionQuery(rw http.ResponseWriter, r *http.Request) {
200204func (api * API ) assetRedirect (rw http.ResponseWriter , r * http.Request ) {
201205 // TODO: Asset URIs can contain a targetPlatform query variable.
202206 baseURL := httpapi .RequestBaseURL (r , "/" )
207+ assetType := chi .URLParam (r , "type" )
208+ if assetType == "vspackage" {
209+ assetType = database .ExtensionAssetType
210+ }
203211 url , err := api .Database .GetExtensionAssetPath (r .Context (), & database.Asset {
204212 Extension : chi .URLParam (r , "extension" ),
205213 Publisher : chi .URLParam (r , "publisher" ),
206- Type : chi . URLParam ( r , "type" ) ,
214+ Type : assetType ,
207215 Version : chi .URLParam (r , "version" ),
208216 }, baseURL )
209217 if err != nil && os .IsNotExist (err ) {
0 commit comments