Uploaded image for project: 'Nuxeo Platform'
  1. Nuxeo Platform
  2. NXP-29606

Fix Management REST API port guard check

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: ADDONS_10.10, 11.3, 2021.0
    • Component/s: Rest API

      Description

      When deploying the Management REST API on the nxdev environment to qualify the 11.3, we discover that the guard checking the port doesn't work as expected when:

      • Management REST API is configured to run behind the same port as regular REST API (ie: blank nuxeo.management.api.http.port)
      • Nuxeo is behind a reverse proxy such as Nginx

      The culprit code is:

          protected boolean requestIsOnConfiguredPort(ServletRequest request) {
              int port = request.getServerPort();
              String configPort = Framework.getProperty(MANAGEMENT_API_HTTP_PORT_PROPERTY,
                      Framework.getProperty(PARAM_HTTP_PORT));
              return Integer.parseInt(configPort) == port;
          }
      

      In the case presented above, port is 80.

      We want to fix this guard.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour
                  1h