Uploaded image for project: '[Read Only] - Hippo Site Toolkit 2'
  1. [Read Only] - Hippo Site Toolkit 2
  2. HSTTWO-1632

HTTP 204 Return from REST APIs need to return 200 instead for JavaScript clients

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • 2.20.03, 2.21.01, 2.22.01, 2.23.00
    • 2.23.01
    • None
    • None

    Description

      Currently, some built-in REST service operations do not have return, so CXF returns 204 code instead of 200 code.
      Because of this, JavaScript client cannot handle html form complete events properly; 204 code is not supported for JavaScript clients. See [1].
      Therefore, I think we should change the operations to return something such as simple result xml/json string with status code 200.

      By the way, regarding this problem, the following comment was wrong in [2]:

      #226: // Because YUI3 doesn't fire io:complete event handler properly with io-upload-iframe,
      #227: // refresh image after 3 seconds as a temporary solution.
      #228: asyncQueue.add({fn: function() {}, timeout: 3000}, refreshProductImage);
      #229: asyncQueue.run();

      It was not caused by YUI3, but caused by the server side 204 status codes. We need to fix this example as well to handle events properly instead of inaccurate timer based behavior.

      [1] http://stackoverflow.com/questions/6012853/detecting-http-204-status-of-submitted-form
      [2] http://svn.onehippo.org/repos/hippo/hippo-cms7/site-toolkit/trunk/demosuite/site/src/main/webapp/WEB-INF/jsp/components/main/productpage.jsp

      Attachments

        Activity

          People

            wko Woonsan Ko (Inactive)
            wko Woonsan Ko (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: