diff --git a/CHANGELOG.md b/CHANGELOG.md index fa8d0848f6..4a374b0602 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ ### Bug Fixes - **autoupdate:** Allow checksum file that contains whitespaces ([#4619](https://github.com/ScoopInstaller/Scoop/issues/4619)) +- **autoupdate:** Rename $response to $res ([#4706](https://github.com/ScoopInstaller/Scoop/issues/4706)) - **config:** Allow scoop config use Unicode characters ([#4631](https://github.com/ScoopInstaller/Scoop/issues/4631)) - **current:** Remove 'current' while it's not a junction ([#4687](https://github.com/ScoopInstaller/Scoop/issues/4687)) - **depends:** Prevent error on no URL ([#4595](https://github.com/ScoopInstaller/Scoop/issues/4595)) diff --git a/lib/autoupdate.ps1 b/lib/autoupdate.ps1 index ac31a812ac..5d1b531c9e 100644 --- a/lib/autoupdate.ps1 +++ b/lib/autoupdate.ps1 @@ -152,7 +152,7 @@ function find_hash_in_headers([String] $url) { $req.Timeout = 2000 $req.Method = 'HEAD' $res = $req.GetResponse() - if(([int]$response.StatusCode -ge 300) -and ([int]$response.StatusCode -lt 400)) { + if(([int]$res.StatusCode -ge 300) -and ([int]$res.StatusCode -lt 400)) { if($res.Headers['Digest'] -match 'SHA-256=([^,]+)' -or $res.Headers['Digest'] -match 'SHA=([^,]+)' -or $res.Headers['Digest'] -match 'MD5=([^,]+)') { $hash = ([System.Convert]::FromBase64String($matches[1]) | ForEach-Object { $_.ToString('x2') }) -join '' debug $hash