Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-13541

Content Type of JSON API responses is not 'application/json'

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When making requests to the JSON API, responses are specifying a content type of application/javascript instead of application/json as defined in RFC4627

      The following is the response form http://ci.jenkins-ci.org/view/Jenkins core/api/json

      HTTP/1.1 200 OK
      Content-Length: 640
      Server: Winstone Servlet Engine v0.9.10
      Content-Type: application/javascript;charset=UTF-8
      Connection: Close
      Date: Sat, 21 Apr 2012 03:55:50 GMT
      X-Powered-By: Servlet/2.5 (Winstone/0.9.10)
      Set-Cookie: SERVERID=Local; path=/
      Cache-Control: private
      

        Attachments

          Issue Links

            Activity

            Hide
            kukido Andrey Myatlyuk added a comment -

            Jenkins sets content type based on the requested export format. Whenever json format is requested, we use Flavor enumeration from Stapler framework to set response content type.

            https://github.com/stapler/stapler/blob/master/core/src/main/java/org/kohsuke/stapler/export/Flavor.java

            Currently for JSON flavor it has "application/javascript" content type.

            Show
            kukido Andrey Myatlyuk added a comment - Jenkins sets content type based on the requested export format. Whenever json format is requested, we use Flavor enumeration from Stapler framework to set response content type. https://github.com/stapler/stapler/blob/master/core/src/main/java/org/kohsuke/stapler/export/Flavor.java Currently for JSON flavor it has "application/javascript" content type.
            Hide
            kukido Andrey Myatlyuk added a comment -

            Submitted request on Stapler project, once I get green light on that, that issue with Jenkins will be consequently resolved.

            http://java.net/jira/browse/STAPLER-17

            Show
            kukido Andrey Myatlyuk added a comment - Submitted request on Stapler project, once I get green light on that, that issue with Jenkins will be consequently resolved. http://java.net/jira/browse/STAPLER-17
            Hide
            kukido Andrey Myatlyuk added a comment - - edited

            Fixed in version 1.471

            Connection Keep-Alive
            Content-Encoding gzip
            Content-Length 313
            Content-Type application/json;charset=UTF-8
            Date Thu, 14 Jun 2012 19:39:10 GMT
            Server Winstone Servlet Engine v0.9.10
            X-Powered-By Servlet/2.5 (Winstone/0.9.10)

            Please verify.

            Show
            kukido Andrey Myatlyuk added a comment - - edited Fixed in version 1.471 Connection Keep-Alive Content-Encoding gzip Content-Length 313 Content-Type application/json;charset=UTF-8 Date Thu, 14 Jun 2012 19:39:10 GMT Server Winstone Servlet Engine v0.9.10 X-Powered-By Servlet/2.5 (Winstone/0.9.10) Please verify.
            Hide
            jmutter Justin Mutter added a comment -

            Looks good, thanks!

            Show
            jmutter Justin Mutter added a comment - Looks good, thanks!
            Hide
            jmutter Justin Mutter added a comment -

            Updated to 1.471 and confirmed correct JSON content type

            Show
            jmutter Justin Mutter added a comment - Updated to 1.471 and confirmed correct JSON content type
            Hide
            scm_issue_link SCM/JIRA link daemon added a comment -

            Code changed in jenkins
            User: Jesse Glick
            Path:
            changelog.html
            http://jenkins-ci.org/commit/jenkins/bb3be8314cc04c54838331da088d35e46b68a224
            Log:
            JENKINS-13541 Noting.

            Show
            scm_issue_link SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html http://jenkins-ci.org/commit/jenkins/bb3be8314cc04c54838331da088d35e46b68a224 Log: JENKINS-13541 Noting.
            Hide
            dogfood dogfood added a comment -

            Integrated in jenkins_main_trunk #2208
            JENKINS-13541 Noting. (Revision bb3be8314cc04c54838331da088d35e46b68a224)

            Result = SUCCESS
            Jesse Glick : bb3be8314cc04c54838331da088d35e46b68a224
            Files :

            • changelog.html
            Show
            dogfood dogfood added a comment - Integrated in jenkins_main_trunk #2208 JENKINS-13541 Noting. (Revision bb3be8314cc04c54838331da088d35e46b68a224) Result = SUCCESS Jesse Glick : bb3be8314cc04c54838331da088d35e46b68a224 Files : changelog.html

              People

              Assignee:
              kukido Andrey Myatlyuk
              Reporter:
              jmutter Justin Mutter
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: