Uploaded image for project: 'OpenNMS'
  1. OpenNMS
  2. NMS-6800

HTTPDetector does not work with Go programs (http request is invalid)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 1.13.4
    • Fix Version/s: 14.0.0
    • Component/s: Data Collection - HTTP
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None

      Description

      When OpenNMS attempts to detect HTTP based services, it is placing an extra space character in the HTTP request that cause some languages (Go) to think that the request is malformed.

      The HTTP specification actually only calls for 1 space: http://www.w3.org/Protocols/HTTP/1.0/spec.html#Request-Line

      here is the code that makes the request in opennms-provision/opennms-detector-lineoriented/src/main/java/org/opennms/netmgt/provision/detector/simple/HttpDetector.java

          protected String httpCommand(final String command) {
      
              return String.format("%s %s  HTTP/1.0\r\n\r\n", command, getUrl());
          }
      

      You will notice there are two spaces between the %s and HTTP - if this were one space then the request would be well-formed.

        Attachments

          Activity

            People

            • Assignee:
              mvr Markus von RĂ¼den
              Reporter:
              szinck Shaun Zinck
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: