Skip to content

Commit

Permalink
A few bugfixes (#3291)
Browse files Browse the repository at this point in the history
nuget.org doesn't expect authentication

---------

Co-authored-by: freddydk <freddydk@users.noreply.github.com>
  • Loading branch information
freddydk and freddydk committed Jan 8, 2024
1 parent 93ef672 commit ef8b276
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion NuGet/NuGetFeedClass.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ class NuGetFeed {
$headers = @{
"Content-Type" = "application/json; charset=utf-8"
}
if ($this.token) {
# nuget.org only support anonymous access
if ($this.token -and $this.url -notlike 'https://api.nuget.org/*') {
$headers += @{
"Authorization" = "Basic $([Convert]::ToBase64String([System.Text.Encoding]::UTF8.GetBytes("user:$($this.token)")))"
}
Expand Down
2 changes: 1 addition & 1 deletion NuGet/Push-BcNuGetPackage.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Function Push-BcNuGetPackage {
[string] $bcNuGetPackage
)

$nuGetFeed = [NuGetFeed]::Create($nuGetServerUrl, $nuGetToken, @('*'), ($VerbosePreference -eq 'Continue'))
$nuGetFeed = [NuGetFeed]::Create($nuGetServerUrl, $nuGetToken, @(), @())
$nuGetFeed.PushPackage($bcNuGetPackage)
}
Export-ModuleMember -Function Push-BcNuGetPackage

0 comments on commit ef8b276

Please sign in to comment.