Skip to content

Commit 73b8038

Browse files
authored
Suppress ValidateAntiForgeryToken message in FxCop (nuget.exe doesn't provide one) (#7998)
1 parent b1e4262 commit 73b8038

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/NuGetGallery/Controllers/PackagesController.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
using System.Collections.Generic;
66
using System.Collections.Specialized;
77
using System.Diagnostics;
8+
using System.Diagnostics.CodeAnalysis;
89
using System.Globalization;
910
using System.IO;
1011
using System.Linq;
@@ -799,6 +800,7 @@ private static async Task<byte[]> ReadPackageFile(PackageArchiveReader packageAr
799800

800801
// This additional delete action addresses issue https://github.com/NuGet/Engineering/issues/2866 - we need to error out.
801802
[HttpDelete]
803+
[SuppressMessage("Microsoft.Security.Web.Configuration", "CA3147: Missing ValidateAntiForgeryTokenAttribute", Justification = "nuget.exe will not provide a token")]
802804
public HttpStatusCodeResult DisplayPackage()
803805
=> new HttpStatusCodeWithHeadersResult(HttpStatusCode.MethodNotAllowed, new NameValueCollection() { { "allow", "GET" } });
804806

0 commit comments

Comments
 (0)