could give json a chance
This commit is contained in:
parent
72a99c8bd5
commit
90e368c452
1 changed files with 9 additions and 1 deletions
|
|
@ -65,6 +65,14 @@ namespace Yavsc.Controllers
|
|||
{
|
||||
if (Response.StatusCode != 200)
|
||||
{
|
||||
if (Request.Headers.Keys.Contains("Accept")) {
|
||||
var accepted = Request.Headers["Accept"];
|
||||
if (accepted.Contains("application/json"))
|
||||
{
|
||||
return new BadRequestObjectResult(new { error = this.HttpContext.Items } );
|
||||
}
|
||||
}
|
||||
|
||||
return View("AuthorizeError");
|
||||
}
|
||||
|
||||
|
|
@ -135,7 +143,7 @@ namespace Yavsc.Controllers
|
|||
|
||||
if (Request.Headers.Keys.Contains("Accept")) {
|
||||
var accepted = Request.Headers["Accept"];
|
||||
if (accepted == "application/json")
|
||||
if (accepted.Contains("application/json"))
|
||||
{
|
||||
return Ok(model);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue