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

CXF returning 204 on NULL responses, rather than 404

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved (View Workflow)
    • Priority: Blocker
    • Resolution: Fixed
    • Affects Version/s: 17.1.0
    • Fix Version/s: 18.0.0, Meridian-2016.1.0
    • Component/s: REST
    • Security Level: Default (Default Security Scheme)
    • Labels:
      None

      Description

      Not sure if this affects other things, but at least with the requisitions API, when I request a requisition that doesn't exist, I'm getting a 204 (NO CONTENT) rather than a 404 (NOT FOUND).

      AFAIK, 204 is only for when the person made a valid request that matched an entity, but that entity is empty.

      $ curl -L -o - -u admin:admin --verbose http://localhost:8980/opennms/rest/requisitions/foreign-source-that-does-not-exist
      *   Trying ::1...
      * Connected to localhost (::1) port 8980 (#0)
      * Server auth using Basic with user 'admin'
      > GET /opennms/rest/requisitions/foreign-source-that-does-not-exist HTTP/1.1
      > Host: localhost:8980
      > Authorization: Basic YWRtaW46YWRtaW4=
      > User-Agent: curl/7.43.0
      > Accept: */*
      > 
      < HTTP/1.1 204 No Content
      < Set-Cookie: JSESSIONID=1r8pksij9kq642ktmjxyxf2jf;Path=/opennms
      < Expires: Thu, 01 Jan 1970 00:00:00 GMT
      < Date: Tue, 09 Feb 2016 21:05:37 GMT
      < Content-Length: 0
      < Server: Jetty(8.1.10.v20130312)
      < 
      * Connection #0 to host localhost left intact

        Attachments

          Activity

            People

            • Assignee:
              agalue Alejandro Galue
              Reporter:
              ranger Benjamin Reed
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: