File tree Expand file tree Collapse file tree 2 files changed +9
-6
lines changed
Expand file tree Collapse file tree 2 files changed +9
-6
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' tauri ' : ' patch'
3+ ---
4+
5+ Fix ` UpdaterBuilder::check ` returning a parsing error when ` 204 ` is sent from server where it should instead return a ` UpToDate ` error.
Original file line number Diff line number Diff line change @@ -383,18 +383,16 @@ impl<R: Runtime> UpdateBuilder<R> {
383383 // If we got a success, we stop the loop
384384 // and we set our remote_release variable
385385 if let Ok ( res) = resp {
386- let res = res. read ( ) . await ? ;
386+ let status = res. status ( ) ;
387387 // got status code 2XX
388- if StatusCode :: from_u16 ( res. status )
389- . map_err ( |e| Error :: Builder ( e. to_string ( ) ) ) ?
390- . is_success ( )
391- {
388+ if status. is_success ( ) {
392389 // if we got 204
393- if StatusCode :: NO_CONTENT . as_u16 ( ) == res . status {
390+ if status == StatusCode :: NO_CONTENT {
394391 // return with `UpToDate` error
395392 // we should catch on the client
396393 return Err ( Error :: UpToDate ) ;
397394 } ;
395+ let res = res. read ( ) . await ?;
398396 // Convert the remote result to our local struct
399397 let built_release = serde_json:: from_value ( res. data ) . map_err ( Into :: into) ;
400398 // make sure all went well and the remote data is compatible
You can’t perform that action at this time.
0 commit comments