mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
32 lines
616 B
C#
32 lines
616 B
C#
using System.Web.Mvc;
|
|
|
|
public class HomeController : Controller
|
|
{
|
|
// BAD: Anti forgery token has been forgotten
|
|
[HttpPost]
|
|
public ActionResult Login()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
// GOOD: Anti forgery token is validated
|
|
[HttpPost]
|
|
[ValidateAntiForgeryToken]
|
|
public ActionResult UpdateDetails()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
// No validation required, as this is a GET method.
|
|
public ActionResult ShowHelp()
|
|
{
|
|
return View();
|
|
}
|
|
|
|
// Should be ignored, because it is not an action method
|
|
[NonAction]
|
|
public void UtilityMethod()
|
|
{
|
|
}
|
|
}
|