JsonResult should return content-type application/json

XMLWordPrintable

      JsonResult returns a response with a content-type of text/javascript (was previously application/javascript) but according to the IETF JSON specification it should be "application/json".

      This content-type is what jQuery treats as JSON if a dataType isn't specified - text/javascript is treated as JavaScript code that will successfully run when embedded in a <script> tag. Passing a JSON into a <script> causes errors in some browsers (i.e. IE).

      See http://api.jquery.com/jQuery.ajax for jQuery's description of the dataType option - the default is "Intelligent Guess".

              Assignee:
              David Taylor (Inactive)
              Reporter:
              David Taylor (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

                Created:
                Updated:
                Resolved: