support both 404 andf 403 status codes in API response (404 should not log)
This commit is contained in:
@ -89,11 +89,15 @@ namespace Oqtane.Controllers
|
||||
}
|
||||
else
|
||||
{
|
||||
if (entityName != EntityNames.Visitor)
|
||||
if (setting != null && entityName != EntityNames.Visitor)
|
||||
{
|
||||
_logger.Log(LogLevel.Error, this, LogFunction.Read, "User Not Authorized To Access Setting {EntityName} {SettingId}", entityName, id);
|
||||
HttpContext.Response.StatusCode = (int)HttpStatusCode.Forbidden;
|
||||
}
|
||||
else
|
||||
{
|
||||
HttpContext.Response.StatusCode = (int)HttpStatusCode.NotFound;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user