Uploaded image for project: 'Dev - Nexus Repo'
  1. Dev - Nexus Repo
  2. NEXUS-29031

npm proxy on Nexus Repository 2 doesn't handle conditional GET requests from Nexus Repository 3

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: New
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.14.20
    • Fix Version/s: None
    • Component/s: NPM
    • Labels:
    • Notability:
      2

      Description

      1. Create a proxy repository from Nexus Repo 2.14.20 to the npm registry.
      2. Create a proxy repository in Nexus Repo 3.34.1 to the proxy you just created in NXRM 2.
      3. Request metadata through the Nexus Repo 3 proxy twice.
      4. Observe that both requests get a 200 response along with full content.

      127.0.0.1 - - [23/Sep/2021:10:48:36 -0500] "GET /nexus/content/repositories/npm-proxy/lodash HTTP/1.1" 200 213932 16
      127.0.0.1 - - [23/Sep/2021:10:48:43 -0500] "GET /nexus/content/repositories/npm-proxy/lodash HTTP/1.1" 200 213932 12

      This shouldn't be the case, Nexus Repo 3 is sending a conditional get request:

      2021-09-23 10:48:43,763-0500 DEBUG [qtp674795338-111] *UNKNOWN org.apache.http.headers - http-outgoing-0 >> GET /nexus/content/repositories/npm-proxy/lodash HTTP/1.1
      2021-09-23 10:48:43,763-0500 DEBUG [qtp674795338-111] *UNKNOWN org.apache.http.headers - http-outgoing-0 >> If-Modified-Since: Thu, 23 Sep 2021 15:48:36 GMT
      2021-09-23 10:48:43,764-0500 DEBUG [qtp674795338-111] *UNKNOWN org.apache.http.headers - http-outgoing-0 >> Host: localhost:8081
      2021-09-23 10:48:43,764-0500 DEBUG [qtp674795338-111] *UNKNOWN org.apache.http.headers - http-outgoing-0 >> Connection: Keep-Alive
      2021-09-23 10:48:43,765-0500 DEBUG [qtp674795338-111] *UNKNOWN org.apache.http.headers - http-outgoing-0 >> User-Agent: Nexus/3.34.1-01 (PRO; Mac OS X; 10.16; x86_64; 1.8.0_252)
      2021-09-23 10:48:43,765-0500 DEBUG [qtp674795338-111] *UNKNOWN org.apache.http.headers - http-outgoing-0 >> Accept-Encoding: gzip,deflate
      2021-09-23 10:48:43,777-0500 DEBUG [qtp674795338-111] *UNKNOWN org.apache.http.headers - http-outgoing-0 << HTTP/1.1 200 OK

      Retrieval of npm metadata in Nexus Repo 2.x can be very expensive due to the need to construct a potentially large JSON object in memory.

      Expected: Conditional get requests using the If-Modified-Since header should work in Nexus Repo 2 npm repositories. This should be tested against hosted, proxy, and group repositories.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              rseddon Rich Seddon
              Last Updated By:
              Michael Oliverio Michael Oliverio
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Date of First Response:

                  tigCommentSecurity.panel-title