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

HTTP Content-Range Header one byte past file length and missing "bytes" unit

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • core

      Downloading a PDF artifact using Chrome (17.0.963.79 m on Windows) the HTTP header for the last partial entity-body sent back by Jenkins contains:
      Content-Range: 2613923-2646691/2646691\r\n
      I believe this is wrong according to http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.16 . I believe the last range should be 2613923-2646690/2646691, because the numbers are 0-indexed.

      I'm not sure whether this is caused by this or is a separate issue, but Chrome keeps requesting the same last partial segment and Jenkins returns the same one in an endless loop. Thus Chrome is stuck loading the PDF at 100% in the endless loop. This only happens with the Chrome embedded PDF viewer. The file downloads correctly with "Save as".

      Update: It now appears that the content-range unit "bytes" is missing from the header.

          [JENKINS-13125] HTTP Content-Range Header one byte past file length and missing "bytes" unit

          Roland Schulz created issue -
          Roland Schulz made changes -
          Component/s New: www [ 15484 ]
          Component/s Original: core [ 15593 ]

          Reproduced with Jenkins 1.461 running on Winstone.

          The archived file's length is 1716 bytes.
          It seems that "last-byte-pos" in Content-Range header is always bigger by 1 byte.

          GET ****** HTTP/1.1
          Range: bytes=0-1
          Host: ******:8888
          
          HTTP/1.1 206 Partial Content
          Server: Winstone Servlet Engine v0.9.10
          Last-Modified: Wed, 25 Apr 2012 01:54:31 GMT
          Expires: Wed, 25 Apr 2012 01:54:31 GMT
          Accept-Ranges: bytes
          Content-Type: application/java-archive
          Content-Range: 0-2/1716
          Content-Length: 2
          Connection: Keep-Alive
          Date: Wed, 25 Apr 2012 08:49:28 GMT
          X-Powered-By: Servlet/2.5 (Winstone/0.9.10)
          
          GET ****** HTTP/1.1
          Range: bytes=1715-
          Host: ******:8888
          
          HTTP/1.1 206 Partial Content
          Server: Winstone Servlet Engine v0.9.10
          Last-Modified: Wed, 25 Apr 2012 01:54:31 GMT
          Expires: Wed, 25 Apr 2012 01:54:31 GMT
          Accept-Ranges: bytes
          Content-Type: application/java-archive
          Content-Range: 1715-1716/1716
          Content-Length: 1
          Connection: Keep-Alive
          Date: Wed, 25 Apr 2012 08:50:00 GMT
          X-Powered-By: Servlet/2.5 (Winstone/0.9.10)
          

          OHTAKE Tomohiro added a comment - Reproduced with Jenkins 1.461 running on Winstone. The archived file's length is 1716 bytes. It seems that "last-byte-pos" in Content-Range header is always bigger by 1 byte. GET ****** HTTP/1.1 Range: bytes=0-1 Host: ******:8888 HTTP/1.1 206 Partial Content Server: Winstone Servlet Engine v0.9.10 Last-Modified: Wed, 25 Apr 2012 01:54:31 GMT Expires: Wed, 25 Apr 2012 01:54:31 GMT Accept-Ranges: bytes Content-Type: application/java-archive Content-Range: 0-2/1716 Content-Length: 2 Connection: Keep-Alive Date: Wed, 25 Apr 2012 08:49:28 GMT X-Powered-By: Servlet/2.5 (Winstone/0.9.10) GET ****** HTTP/1.1 Range: bytes=1715- Host: ******:8888 HTTP/1.1 206 Partial Content Server: Winstone Servlet Engine v0.9.10 Last-Modified: Wed, 25 Apr 2012 01:54:31 GMT Expires: Wed, 25 Apr 2012 01:54:31 GMT Accept-Ranges: bytes Content-Type: application/java-archive Content-Range: 1715-1716/1716 Content-Length: 1 Connection: Keep-Alive Date: Wed, 25 Apr 2012 08:50:00 GMT X-Powered-By: Servlet/2.5 (Winstone/0.9.10)

          Code changed in jenkins
          User: Kohsuke Kawaguchi
          Path:
          changelog.html
          core/pom.xml
          http://jenkins-ci.org/commit/jenkins/50593fb7aa158aa1b80a28159146d2f970ad1e98
          Log:
          [FIXED JENKINS-13125] Fixed a bug in Content-Range header handling

          Compare: https://github.com/jenkinsci/jenkins/compare/047fdda...50593fb

          SCM/JIRA link daemon added a comment - Code changed in jenkins User: Kohsuke Kawaguchi Path: changelog.html core/pom.xml http://jenkins-ci.org/commit/jenkins/50593fb7aa158aa1b80a28159146d2f970ad1e98 Log: [FIXED JENKINS-13125] Fixed a bug in Content-Range header handling Compare: https://github.com/jenkinsci/jenkins/compare/047fdda...50593fb
          SCM/JIRA link daemon made changes -
          Resolution New: Fixed [ 1 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          dogfood added a comment -

          Integrated in jenkins_main_trunk #1690
          [FIXED JENKINS-13125] Fixed a bug in Content-Range header handling (Revision 50593fb7aa158aa1b80a28159146d2f970ad1e98)

          Result = UNSTABLE
          Kohsuke Kawaguchi : 50593fb7aa158aa1b80a28159146d2f970ad1e98
          Files :

          • changelog.html
          • core/pom.xml

          dogfood added a comment - Integrated in jenkins_main_trunk #1690 [FIXED JENKINS-13125] Fixed a bug in Content-Range header handling (Revision 50593fb7aa158aa1b80a28159146d2f970ad1e98) Result = UNSTABLE Kohsuke Kawaguchi : 50593fb7aa158aa1b80a28159146d2f970ad1e98 Files : changelog.html core/pom.xml

          dogfood added a comment -

          Integrated in jenkins_ui-changes_branch #26
          [FIXED JENKINS-13125] Fixed a bug in Content-Range header handling (Revision 50593fb7aa158aa1b80a28159146d2f970ad1e98)

          Result = SUCCESS
          Kohsuke Kawaguchi : 50593fb7aa158aa1b80a28159146d2f970ad1e98
          Files :

          • core/pom.xml
          • changelog.html

          dogfood added a comment - Integrated in jenkins_ui-changes_branch #26 [FIXED JENKINS-13125] Fixed a bug in Content-Range header handling (Revision 50593fb7aa158aa1b80a28159146d2f970ad1e98) Result = SUCCESS Kohsuke Kawaguchi : 50593fb7aa158aa1b80a28159146d2f970ad1e98 Files : core/pom.xml changelog.html

          Roland Schulz added a comment -

          I just upgraded to 1.463 but the Chrome internal PDF viewer still gets stuck on a PDF from Jenkins. Thus this doesn't seem to be fixed.

          Roland Schulz added a comment - I just upgraded to 1.463 but the Chrome internal PDF viewer still gets stuck on a PDF from Jenkins. Thus this doesn't seem to be fixed.

          Eric Blom added a comment -

          Like Rolland, we are also running in to this problem on 1.480.3.

          Eric Blom added a comment - Like Rolland, we are also running in to this problem on 1.480.3.

          Eric Blom added a comment -

          I hope I'm not causing a problem here by reopening this issue as I just registered for an account here and might be violating protocol. However, like Roland we still see this issue in v1.480.3.

          Eric Blom added a comment - I hope I'm not causing a problem here by reopening this issue as I just registered for an account here and might be violating protocol. However, like Roland we still see this issue in v1.480.3.
          Eric Blom made changes -
          Resolution Original: Fixed [ 1 ]
          Status Original: Resolved [ 5 ] New: Reopened [ 4 ]

            Unassigned Unassigned
            rschulz Roland Schulz
            Votes:
            5 Vote for this issue
            Watchers:
            8 Start watching this issue

              Created:
              Updated:
              Resolved: