Uploaded image for project: 'Artifactory Binary Repository'
  1. Artifactory Binary Repository
  2. RTFACT-9288

Remote NPM Repos are unencoding slashes

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Resolution: Deferred
    • Affects Version/s: 4.4.2, 4.4.3, 4.13.0
    • Fix Version/s: None
    • Component/s: None
    • Severity:
      High

      Description

      We're on Artifactory Pro 4.4.3. I saw a similar bug here: https://www.jfrog.com/jira/browse/RTFACT-8246

      We still have the exact same problem, but rather than with registry.npmjs.org we have the problem adding a remote repository for our own Sinopia instance.

      In our case, we have "remote-npm" configured to proxy our existing NPM server. I can request this:

      curl 'http://artifactory.workfront.tech/artifactory/api/npm/remote-npm/@wf-titan%2Fcore'

      The json gives me the following url:

      http://artifactory.workfront.tech/artifactory/api/npm/remote-npm/@wf-titan%2fcore/-/core-1.4.4.tgz

      The URL is encoded properly here. But when I attempt to download from that link, I get a 404. The logs from the other end say this:

      http <-- 404, user: admin, req: 'HEAD /@wf-titan/core/-/core-1.4.4.tgz', error: file not found

      Note that the / is no longer encoded. However, other logs from our remote server indicate that it should be. For example when I install that module via NPM directly on the remote server the logs look as you would expect:

      http <-- 200, user: undefined, req: 'GET /@wf-titan%2fcore/-/core-2.0.0.tgz', bytes: 0/30759

      This tells me that Artifactory is unencoding the %2f back to a / before reaching out to the other server, when it shouldn't be.

      Artifactory is configured with the following in catalina.properties:

      org.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true

      Which solved other issues, so I know that it's being applied properly.

        Attachments

          Activity

              People

              Assignee:
              Unassigned
              Reporter:
              joeljohnson Joel Johnson (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Sync Status

                  Connection: RTFACT Sync
                  RTMID-9288 -
                  SYNCHRONIZED
                  • Last Sync Date: