Details
Description
- Create a proxy repository from Nexus Repo 2.14.20 to the npm registry.
- Create a proxy repository in Nexus Repo 3.34.1 to the proxy you just created in NXRM 2.
- Request metadata through the Nexus Repo 3 proxy twice.
- 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
- is related to
-
NEXUS-21371 npm package metadata conditional gets from NXRM to another NXRM always receive a response of 200 instead of 304 when content has not changed
-
- Closed
-
-
NEXUS-12821 add support for application/vnd.npm.install-v1+json abbreviated npm install package metadata in repository manager 2
-
- Closed
-