src/NuGetGallery/Controllers/AppController.cs
/// <summary>
/// This method is to set TrySkipIisCustomErrors flag on failed requests so Json returns for failed requests don't get overwritten by IIS.
/// </summary>
/// <param name="statusCode">HTTP status code for response</param>
/// <param name="obj">Object to Jsonify and return</param>
/// <returns></returns>
This method is to set TrySkipIisCustomErrors flag on failed requests so Json returns for failed requests don't get overwritten by IIS.
This method is to set TrySkipIisCustomErrors flag on failed requests so Json returns for failed requests don ' t get overwritten by IIS .
protected internal JsonResult Json(HttpStatusCode statusCode, object obj, JsonRequestBehavior jsonRequestBehavior)
        {
            Response.StatusCode = (int)statusCode;
            if (statusCode >= HttpStatusCode.BadRequest)
            {
                Response.TrySkipIisCustomErrors = true;
            }
            return Json(obj, jsonRequestBehavior);
        }
protected internal JsonResult Json ( HttpStatusCode statusCode , object obj , JsonRequestBehavior jsonRequestBehavior ) { Response . StatusCode = ( int ) statusCode ; if ( statusCode >= HttpStatusCode . BadRequest ) { Response . TrySkipIisCustomErrors = true ; } return Json ( obj , jsonRequestBehavior ) ; }
This method is to set TrySkipIisCustomErrors flag on failed requests so Json returns for failed requests don't get overwritten by IIS.
This method is to set TrySkipIisCustomErrors flag on failed requests so Json returns for failed requests don ' t get overwritten by IIS .
None
statusCode
HttpStatusCode
HTTP status code for response
HTTP status code for response
obj
object
Object to Jsonify and return
Object to Jsonify and return
jsonRequestBehavior
JsonRequestBehavior