@@ -392,7 +392,7 @@ impl Updater {
392
392
let mut raw_json: Option < serde_json:: Value > = None ;
393
393
let mut last_error: Option < Error > = None ;
394
394
for url in & self . endpoints {
395
- // replace {{current_version}}, {{target}} and {{arch }} in the provided URL
395
+ // replace {{current_version}}, {{target}}, {{arch}} and {{bundle_type }} in the provided URL
396
396
// this is useful if we need to query example
397
397
// https://releases.myapp.com/update/{{target}}/{{arch}}/{{current_version}}
398
398
// will be translated into ->
@@ -404,17 +404,22 @@ impl Updater {
404
404
const CONTROLS_ADD : & AsciiSet = & CONTROLS . add ( b'+' ) ;
405
405
let encoded_version = percent_encoding:: percent_encode ( version, CONTROLS_ADD ) ;
406
406
let encoded_version = encoded_version. to_string ( ) ;
407
+ let installer = installer_for_bundle_type ( bundle_type ( ) )
408
+ . map ( |i| i. name ( ) )
409
+ . unwrap_or ( "unknown" ) ;
407
410
408
411
let url: Url = url
409
412
. to_string ( )
410
413
// url::Url automatically url-encodes the path components
411
414
. replace ( "%7B%7Bcurrent_version%7D%7D" , & encoded_version)
412
415
. replace ( "%7B%7Btarget%7D%7D" , target)
413
416
. replace ( "%7B%7Barch%7D%7D" , self . arch )
417
+ . replace ( "%7B%7Bbundle_type%7D%7D" , installer)
414
418
// but not query parameters
415
419
. replace ( "{{current_version}}" , & encoded_version)
416
420
. replace ( "{{target}}" , target)
417
421
. replace ( "{{arch}}" , self . arch )
422
+ . replace ( "{{bundle_type}}" , installer)
418
423
. parse ( ) ?;
419
424
420
425
log:: debug!( "checking for updates {url}" ) ;
0 commit comments