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

CaseResult/index.jelly can be rendered with text/plain content type

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • junit-plugin
    • None

      CaseResult/index.jelly includes summary.jelly, but a change made by 0460a04f1cafe580d7fd8dff79b28d1cd440346a for JENKINS-19884 makes summary.jelly override the content-type header.

      If the servlet container haven't yet committed a response, this will change the effective content type to "text/plain" while some other servlet containers will no doubt render this as "text/html".

      I think summary.jelly will send out "text/html" content type, unless I'm missing something. If it really needs to be "text/plain", it should only do so when it's loaded from XmlHttpRequest.

          [JENKINS-21261] CaseResult/index.jelly can be rendered with text/plain content type

          The "text/plain" content header was added in 7089a81 for JENKINS-1544.

          The commit message says if the content type is text/html it'll cause a problem in Firefox.

          add jsStringEscape in case test name has quote or backslash. also set text/plain content type on ajax summary response so browser doesn't try to parse response (firefox 3.6 showed error in console with text/html).

          Kohsuke Kawaguchi added a comment - The "text/plain" content header was added in 7089a81 for JENKINS-1544 . The commit message says if the content type is text/html it'll cause a problem in Firefox. add jsStringEscape in case test name has quote or backslash. also set text/plain content type on ajax summary response so browser doesn't try to parse response (firefox 3.6 showed error in console with text/html).

          Kohsuke Kawaguchi added a comment - - edited

          I should use <l:ajax> tag and use its conditional check to test for the content type.

          Kohsuke Kawaguchi added a comment - - edited I should use <l:ajax> tag and use its conditional check to test for the content type.

          I have misdiagnosed the problem. summary.jelly isn't supposed to be included from index.jelly.

          In this case that was happening because CaseResult.testActions include null.

          Kohsuke Kawaguchi added a comment - I have misdiagnosed the problem. summary.jelly isn't supposed to be included from index.jelly . In this case that was happening because CaseResult.testActions include null .

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          test/src/test/java/hudson/tasks/junit/CaseResultTest.java
          http://jenkins-ci.org/commit/jenkins/c88698c0afc35d7427b16349f4d411d184f3ae3f
          Log:
          JENKINS-21261 while I originally misdiagnosed the problem, the test is still marginally useful.

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: test/src/test/java/hudson/tasks/junit/CaseResultTest.java http://jenkins-ci.org/commit/jenkins/c88698c0afc35d7427b16349f4d411d184f3ae3f Log: JENKINS-21261 while I originally misdiagnosed the problem, the test is still marginally useful.

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          core/src/main/java/hudson/tasks/junit/TestResultAction.java
          http://jenkins-ci.org/commit/jenkins/411c3cfecb8094da86fd0397dc8c29c723f53da3
          Log:
          JENKINS-21261

          plugin might erranously put null into the collection, so filter them out

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: core/src/main/java/hudson/tasks/junit/TestResultAction.java http://jenkins-ci.org/commit/jenkins/411c3cfecb8094da86fd0397dc8c29c723f53da3 Log: JENKINS-21261 plugin might erranously put null into the collection, so filter them out

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3192
          JENKINS-21261 while I originally misdiagnosed the problem, the test is still marginally useful. (Revision c88698c0afc35d7427b16349f4d411d184f3ae3f)
          JENKINS-21261 (Revision 411c3cfecb8094da86fd0397dc8c29c723f53da3)

          Result = SUCCESS
          kohsuke : c88698c0afc35d7427b16349f4d411d184f3ae3f
          Files :

          • test/src/test/java/hudson/tasks/junit/CaseResultTest.java

          kohsuke : 411c3cfecb8094da86fd0397dc8c29c723f53da3
          Files :

          • core/src/main/java/hudson/tasks/junit/TestResultAction.java

          dogfood added a comment - Integrated in jenkins_main_trunk #3192 JENKINS-21261 while I originally misdiagnosed the problem, the test is still marginally useful. (Revision c88698c0afc35d7427b16349f4d411d184f3ae3f) JENKINS-21261 (Revision 411c3cfecb8094da86fd0397dc8c29c723f53da3) Result = SUCCESS kohsuke : c88698c0afc35d7427b16349f4d411d184f3ae3f Files : test/src/test/java/hudson/tasks/junit/CaseResultTest.java kohsuke : 411c3cfecb8094da86fd0397dc8c29c723f53da3 Files : core/src/main/java/hudson/tasks/junit/TestResultAction.java

            Unassigned Unassigned
            kohsuke Kohsuke Kawaguchi
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: