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

$prj/ws/some/file returns 200 status code when there is no workspace

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • core
    • None

      See http://issues.hudson-ci.org/browse/HUDSON-8950 for discussion and suggested patch.

          [JENKINS-10450] $prj/ws/some/file returns 200 status code when there is no workspace

          Daniel Beck added a comment -

          jglick Issue description useless as the Hudson tracker is unavailable. Should this be resolved as Incomplete?

          Daniel Beck added a comment - jglick Issue description useless as the Hudson tracker is unavailable. Should this be resolved as Incomplete?

          Jesse Glick added a comment -

          Actually it is still reproducible. For example https://jenkins.ci.cloudbees.com/job/core/job/jenkins_ui-changes/ws/whatever.txt displays an error page in HTML but returns a 200 status code. Will see if I can fix it.

          Searching the web for HUDSON-8950:

          When a project has a workspace, but an attempt is made to retrieve a particular file which is not in it, DirectoryBrowserSupport returns a 404 as you would expect. When a project has no workspace, and an attempt is made to browse it, noWorkspace.jelly is served - with a 200 status code! This is unexpected and can cause problems for remote API clients such as NetBeans which use the ws/ URL namespace to retrieve workspace files: the file appears to exist but the "content" is actually an HTML error message. The attached patch seems to fix the problem without affecting the appearance in a web browser.

          Apparently I submitted a patch that went into Hudson 2.1.1.

          Jesse Glick added a comment - Actually it is still reproducible. For example https://jenkins.ci.cloudbees.com/job/core/job/jenkins_ui-changes/ws/whatever.txt displays an error page in HTML but returns a 200 status code. Will see if I can fix it. Searching the web for HUDSON-8950: When a project has a workspace, but an attempt is made to retrieve a particular file which is not in it, DirectoryBrowserSupport returns a 404 as you would expect. When a project has no workspace, and an attempt is made to browse it, noWorkspace.jelly is served - with a 200 status code! This is unexpected and can cause problems for remote API clients such as NetBeans which use the ws/ URL namespace to retrieve workspace files: the file appears to exist but the "content" is actually an HTML error message. The attached patch seems to fix the problem without affecting the appearance in a web browser. Apparently I submitted a patch that went into Hudson 2.1.1.

          Code changed in jenkins
          User: Jesse Glick
          Path:
          changelog.html
          core/src/main/resources/hudson/model/AbstractItem/noWorkspace.jelly
          test/src/test/java/hudson/model/ProjectTest.java
          http://jenkins-ci.org/commit/jenkins/0adf979c4a3fa630de98da8eedbc6988567a13b7
          Log:
          [FIXED JENKINS-10450] Use 404 status code for noWorkspace.jelly.

          Compare: https://github.com/jenkinsci/jenkins/compare/f8146742ed7b...0adf979c4a3f

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Jesse Glick Path: changelog.html core/src/main/resources/hudson/model/AbstractItem/noWorkspace.jelly test/src/test/java/hudson/model/ProjectTest.java http://jenkins-ci.org/commit/jenkins/0adf979c4a3fa630de98da8eedbc6988567a13b7 Log: [FIXED JENKINS-10450] Use 404 status code for noWorkspace.jelly. Compare: https://github.com/jenkinsci/jenkins/compare/f8146742ed7b...0adf979c4a3f

          dogfood added a comment -

          Integrated in jenkins_main_trunk #3725
          [FIXED JENKINS-10450] Use 404 status code for noWorkspace.jelly. (Revision 0adf979c4a3fa630de98da8eedbc6988567a13b7)

          Result = SUCCESS
          Jesse Glick : 0adf979c4a3fa630de98da8eedbc6988567a13b7
          Files :

          • test/src/test/java/hudson/model/ProjectTest.java
          • changelog.html
          • core/src/main/resources/hudson/model/AbstractItem/noWorkspace.jelly

          dogfood added a comment - Integrated in jenkins_main_trunk #3725 [FIXED JENKINS-10450] Use 404 status code for noWorkspace.jelly. (Revision 0adf979c4a3fa630de98da8eedbc6988567a13b7) Result = SUCCESS Jesse Glick : 0adf979c4a3fa630de98da8eedbc6988567a13b7 Files : test/src/test/java/hudson/model/ProjectTest.java changelog.html core/src/main/resources/hudson/model/AbstractItem/noWorkspace.jelly

            jglick Jesse Glick
            jglick Jesse Glick
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: