Skip to content

Sample project providing better defaults for Newtonsoft Json.Net library

Notifications You must be signed in to change notification settings

dax70/MvcJson.Net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MvcJson.Net

ASP.NET MVC project with better defaults for Newtonsoft Json.Net library

Why use this?

The Json protocol has a vulnerability which can result in disclosing sensitive information. This exploit has being well covered by many others, with a good summary provided by Phil Haack found here: Json hijacking.

Usage

The code usage is seamless with the added benefit of integrating Json.Net and being safe from the security exploit.

public ActionResult Index()
{
    var custs = Customer.GetAll();
    if (Request.IsAjaxRequest())
    {
        return Json(custs);
    }
    return View(custs);
}

Documentation

Blog posts that describe the code in detail.

About

Sample project providing better defaults for Newtonsoft Json.Net library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published