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

npm repository URLs with trailing slash do not respond like the official registry does

    XMLWordPrintable

    Details

    • Story Points:
      2
    • Notability:
      n/a

      Description

      These two requests to the official registry return identical HTTP response codes and bodies.

      https://registry.npmjs.org/@fortawesome/fontawesome-svg-core ( the official npm client will send requests without trailing slash )
      https://registry.npmjs.org/@fortawesome/fontawesome-svg-core/

      Create an npm proxy repo named npm-proxy to the official registry at https://registry.npmjs.org.

      This request returns a successful response (excluding rewritten URLs as expected ) and matches what the official npm client may send

      http://localhost:8081/repository/npm-proxy/@fortawesome/fontawesome-svg-core

      This request with trailing slash

      http://localhost:8081/repository/npm-proxy/@fortawesome/fontawesome-svg-core/

      returns a 200 response but HTML content containing:

      <div class="content-section">
            <p>
              This npm proxy repository is not directly browseable at this URL.
            </p>
      
            <p>
              Please use the <a href="http://localhost:8081/#browse/browse:npm-proxy">browse</a>
              or <a href="http://localhost:8081/service/rest/repository/browse/npm-proxy/">HTML index</a>
              views to inspect the contents of this repository.
            </p>
          </div>

      Compare NXRM 3 with NXRM 2 - both of these requests return a 200 response and identical JSON against NXRM 2:

      http://localhost:8081/nexus/content/repositories/npm-proxy/@fortawesome/fontawesome-svg-core
      http://localhost:8081/nexus/content/repositories/npm-proxy/@fortawesome/fontawesome-svg-core/

      Expected

      Respond to and proxy trailing slash URLs in the same way the official registry does.

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            plynch Peter Lynch
            Last Updated By:
            Dawid Sawa Dawid Sawa
            Team:
            NXRM - Mad Max
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Date of First Response:

                tigCommentSecurity.panel-title