Skip to content

Commit

Permalink
feat(install): Do not send referer to portableapps
Browse files Browse the repository at this point in the history
  • Loading branch information
Ash258 committed May 19, 2020
1 parent 821d6ce commit d75cbdb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/install.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ function dl_with_cache_aria2($app, $version, $manifest, $architecture, $dir, $co
$has_downloads = $true
# create aria2 input file content
$urlstxt_content += "$(handle_special_urls $url)`n"
if (!$url.Contains('sourceforge.net')) {
if (($url -notlike '*sourceforge.net/*') -or ($url -notlike '*portableapps.com/*')) {
$urlstxt_content += " referer=$(strip_filename $url)`n"
}
$urlstxt_content += " dir=$cachedir`n"
Expand Down Expand Up @@ -368,7 +368,7 @@ function dl($url, $to, $cookies, $progress) {
$wreq = [net.webrequest]::create($reqUrl)
if ($wreq -is [net.httpwebrequest]) {
$wreq.useragent = Get-UserAgent
if (-not ($url -imatch "sourceforge\.net")) {
if (($url -notlike '*.sourceforge.net/*') -or ($url -notlike '*.portableapps.com/*')) {
$wreq.referer = strip_filename $url
}
if ($cookies) {
Expand Down

0 comments on commit d75cbdb

Please sign in to comment.