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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Similar Issues:

      Description

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

        Attachments

          Activity

          Hide
          danielbeck Daniel Beck added a comment -

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

          Show
          danielbeck Daniel Beck added a comment - Jesse Glick Issue description useless as the Hudson tracker is unavailable. Should this be resolved as Incomplete?
          Hide
          jglick 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.

          Show
          jglick 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.
          Hide
          scm_issue_link 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

          Show
          scm_issue_link 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
          Hide
          dogfood 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
          Show
          dogfood 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

            People

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

              Dates

              Created:
              Updated:
              Resolved: