Skip to content

Commit

Permalink
fix Trucated typo (#9996)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonCropp authored Jun 20, 2024
1 parent 85bc8d2 commit 786c36b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/NuGetGallery/Controllers/PackagesController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1240,15 +1240,15 @@ public virtual async Task<ActionResult> License(string id, string version)
/// In this way, we could read very large stream from blob storage with max size restriction.
/// </remarks>
using (var licenseFileStream = await _coreLicenseFileService.DownloadLicenseFileAsync(package))
using (var licenseFileTrucatedStream = await licenseFileStream.GetTruncatedStreamWithMaxSizeAsync(MaxAllowedLicenseLengthForDisplaying))
using (var licenseFileTruncatedStream = await licenseFileStream.GetTruncatedStreamWithMaxSizeAsync(MaxAllowedLicenseLengthForDisplaying))
{
if (licenseFileTrucatedStream.IsTruncated)
if (licenseFileTruncatedStream.IsTruncated)
{
throw new InvalidOperationException(string.Format(CultureInfo.CurrentCulture, "The license file exceeds the max limit of {0} to display in Gallery", MaxAllowedLicenseLengthForDisplaying));
}
else
{
licenseFileContents = Encoding.UTF8.GetString(licenseFileTrucatedStream.Stream.GetBuffer(), 0, (int)licenseFileTrucatedStream.Stream.Length);
licenseFileContents = Encoding.UTF8.GetString(licenseFileTruncatedStream.Stream.GetBuffer(), 0, (int)licenseFileTruncatedStream.Stream.Length);
}
}
}
Expand Down

0 comments on commit 786c36b

Please sign in to comment.