Skip to content

Commit 35207e2

Browse files
snowmanse35710
authored andcommitted
fix(autoupdate): rename $response to $res (ScoopInstaller#4706)
* fix(autoupdate): rename $response to $res * docs(changelog): Update CHANGELOG.md
1 parent 7d46ea3 commit 35207e2

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
### Bug Fixes
1010

1111
- **autoupdate:** Allow checksum file that contains whitespaces ([#4619](https://github.com/ScoopInstaller/Scoop/issues/4619))
12+
- **autoupdate:** Rename $response to $res ([#4706](https://github.com/ScoopInstaller/Scoop/issues/4706))
1213
- **config:** Allow scoop config use Unicode characters ([#4631](https://github.com/ScoopInstaller/Scoop/issues/4631))
1314
- **current:** Remove 'current' while it's not a junction ([#4687](https://github.com/ScoopInstaller/Scoop/issues/4687))
1415
- **depends:** Prevent error on no URL ([#4595](https://github.com/ScoopInstaller/Scoop/issues/4595))

lib/autoupdate.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ function find_hash_in_headers([String] $url) {
152152
$req.Timeout = 2000
153153
$req.Method = 'HEAD'
154154
$res = $req.GetResponse()
155-
if(([int]$response.StatusCode -ge 300) -and ([int]$response.StatusCode -lt 400)) {
155+
if(([int]$res.StatusCode -ge 300) -and ([int]$res.StatusCode -lt 400)) {
156156
if($res.Headers['Digest'] -match 'SHA-256=([^,]+)' -or $res.Headers['Digest'] -match 'SHA=([^,]+)' -or $res.Headers['Digest'] -match 'MD5=([^,]+)') {
157157
$hash = ([System.Convert]::FromBase64String($matches[1]) | ForEach-Object { $_.ToString('x2') }) -join ''
158158
debug $hash

0 commit comments

Comments
 (0)