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

line-ending mismatch between the Jenkins HTTP server implementation and the HTTP specification

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Major Major
    • core
    • window senvironment, windows 2008 server

      When I submit using json the server responds with error 400, the same exact submittal with jenkins version 1.5.30 and below gives me a success. We looked at this some more and found this out .

      The root of this problem is a line-ending mismatch between the Jenkins HTTP server implementation and the HTTP specification. The HTTP RFC specifies \r\n (CRLF, (Windows line endings)) to be the line endings for HTTP. However, almost all servers also support \n (UNIX line endings). Invoking the Jenkins' HTTP API on a linux machine directly via the 'curl' command line tool is happy with the \n line-endings (which curl defaults to on linux). However, forcing curl to use \r\n as its line endings causes the transaction to fail using the same error code the obs.py fails with.

      Now, for the fun part (why we can't work around this easily) - We checked the underlying Python library httplib we use has \r\n hardcoded as that's what the HTTP specification calls for. There is no option to switch it to \n.

        1. errorabove1530jenkins.txt
          0.9 kB
          Narayan Kamath
        2. System Information [Jenkins].pdf
          212 kB
          Narayan Kamath

            Unassigned Unassigned
            narayankamath Narayan Kamath
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: