I have an ASP.NET MVC action that is returning JSON. The only place I am calling that action is from one page with this code:
$.ajax({
type: 'POST',
url: actionUrl,
dataType: 'json',
...
});
The page and this AJAX call are working fine from the user and testing perspective. However I found one error in the log saying:
This request has been blocked because sensitive information could be disclosed to third party web sites when this is used in a GET request. To allow GET requests, set JsonRequestBehavior to AllowGet.
and indicating my "actionUrl" in the SCRIPT_NAME
server variable. The REQUEST_METHOD
is GET
and QUERY_STRING
is empty. There is also a HTTP_REFERER
server variable which indicates it is coming from the page with the above $.ajax()
call, so it doesn't seem likely it's someone is accessing the JSON action manually.
The only thing I have come up with is that something strange might happen if the user hits the Back
or Refresh
buttons in the browser, but that doesn't seem right.
Is there any solid explanation of how that one GET request could have been generated?