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

Npm metadata doesn't return Etag on 304 requests with If-None-Match

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Normal
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      According to https://tools.ietf.org/html/rfc7232#section-4.1, if a server returns an ETag as part of a 200 response for a resource, it should also return it for a 304 response.

      curl -u admin:password -vvv http://localhost:8081/artifactory/api/npm/npm2/@angular%2fcompiler

      • Trying ::1...
      • Connected to localhost (::1) port 8081 (#0)
      • Server auth using Basic with user 'admin'
        > GET /artifactory/api/npm/npm2/@angular%2fcompiler HTTP/1.1
        > Host: localhost:8081
        > Authorization: Basic YWRtaW46cGFzc3dvcmQ=
        > User-Agent: curl/7.50.1
        > Accept: /
        >
        < HTTP/1.1 200 OK
        < Server: Artifactory/5.8.3
        < X-Artifactory-Id: 0171e798c9030cbb:-54b7f47b:1617694e25e:-8000
        < X-Checksum-Sha1: 86eeabe10a8c477dfa6007291868ab99b9870423
        < ETag: 86eeabe10a8c477dfa6007291868ab99b9870423
        < Content-Type: application/json
        < Transfer-Encoding: chunked

      However, with the If-None-Match header, the same request does not return a Etag:
      curl -u admin:password -vvv --header 'If-None-Match: 86eeabe10a8c477dfa6007291868ab99b9870423' http://localhost:8081/artifactory/api/npm/npm2/@angular%2fcompiler

      • Trying ::1...
      • Connected to localhost (::1) port 8081 (#0)
      • Server auth using Basic with user 'admin'
        > GET /artifactory/api/npm/npm2/@angular%2fcompiler HTTP/1.1
        > Host: localhost:8081
        > Authorization: Basic YWRtaW46cGFzc3dvcmQ=
        > User-Agent: curl/7.50.1
        > Accept: /
        > If-None-Match: 86eeabe10a8c477dfa6007291868ab99b9870423
        >
        < HTTP/1.1 304 Not Modified
        < Server: Artifactory/5.8.3
        < X-Artifactory-Id: 0171e798c9030cbb:-54b7f47b:1617694e25e:-8000
        < Date: Thu, 08 Feb 2018 18:50:19 GMT

      A pypi request that returns a 304 returns a ETag:
      curl u admin:password -vvv http://10.6.17.221:8081/artifactory/pypi-remote-cache/5e/2f/45ad97064baa86a2b12dc832fb5099f166a959e879b5cc6c333ccf134bf9/granary-1.10.tar.gz > null -H 'If-None-Match: e963e9d3045f7d68a5907c44fd6d2798fa7bbe52'

      • Trying 10.6.17.221...
        % Total % Received % Xferd Average Speed Time Time Time Current
        Dload Upload Total Spent Left Speed
        0 0 0 0 0 0 0 0 -::- -::- -::- 0* Connected to 10.6.17.221 (10.6.17.221) port 8081 (#0)
      • Server auth using Basic with user 'admin'
        > GET /artifactory/pypi-remote-cache/5e/2f/45ad97064baa86a2b12dc832fb5099f166a959e879b5cc6c333ccf134bf9/granary-1.10.tar.gz HTTP/1.1
        > Host: 10.6.17.221:8081
        > Authorization: Basic YWRtaW46cGFzc3dvcmQ=
        > User-Agent: curl/7.50.1
        > Accept: /
        > If-None-Match: e963e9d3045f7d68a5907c44fd6d2798fa7bbe52
        >
        < HTTP/1.1 304 Not Modified
        < Server: Artifactory/5.8.3
        < X-Artifactory-Id: 0171e798c9030cbb:-54b7f47b:1617694e25e:-8000
        < Last-Modified: Sun, 10 Dec 2017 22:24:31 GMT
        < ETag: e963e9d3045f7d68a5907c44fd6d2798fa7bbe52

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                mattheww Matthew Wang
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: