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

Pip requests often ignore "If-None-Match" and "If-Modified-Since" headers

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: High
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 6.6.0
    • Component/s: PyPI
    • Labels:
    • Sprint:
      Leap 34

      Description

      When the If-None-Match or If-Modified-Since headers are used with an /artifactory/api/pypi/<repo>/<path> endpoint, in most situations the headers will be ignored:

      Repository If-None-Match If-Modified-Since
      pypi-local 304 200
      pypi-remote 200 200
      pypi-virtual 200 200

      When instead using the /artifactory/<repo>/<path> endpoint for the same file, all responses are 304's, as they should be.

      Example:

      [~]: curl -uadmin:password -v http://localhost:8088/artifactory/pypi-remote/packages/86/e1/9cde84acb81b2071ebbf490002cb541ad33c52b18c792dfc38321abe7d4a/stripe-1.55.1.tar.gz > /dev/null -H 'If-None-Match: de06e25c9538911caba7164aef1b48cd6a8895cb'
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying ::1...
      * TCP_NODELAY set
      * Connected to localhost (::1) port 8088 (#0)
      * Server auth using Basic with user 'admin'
      > GET /artifactory/pypi-remote/packages/86/e1/9cde84acb81b2071ebbf490002cb541ad33c52b18c792dfc38321abe7d4a/stripe-1.55.1.tar.gz HTTP/1.1
      > Host: localhost:8088
      > Authorization: Basic YWRtaW46cGFzc3dvcmQ=
      > User-Agent: curl/7.54.0
      > Accept: */*
      > If-None-Match: de06e25c9538911caba7164aef1b48cd6a8895cb
      > 
      < HTTP/1.1 304 Not Modified
      < Server: Artifactory/5.2.1
      < X-Artifactory-Id: de448c696d32e70c:7918e7e8:15bf433890b:-8000
      < Last-Modified: Wed, 10 May 2017 20:42:42 GMT
      < ETag: de06e25c9538911caba7164aef1b48cd6a8895cb
      < X-Checksum-Sha1: de06e25c9538911caba7164aef1b48cd6a8895cb
      < Accept-Ranges: bytes
      < X-Checksum-Md5: 0fd6311ea0a2ed40d41cf733de53787e
      < X-Artifactory-Filename: stripe-1.55.1.tar.gz
      < Content-Disposition: attachment; filename="stripe-1.55.1.tar.gz"; filename*=UTF-8''stripe-1.55.1.tar.gz
      < Date: Wed, 10 May 2017 22:14:34 GMT
      < 
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      * Connection #0 to host localhost left intact
      [~]: curl -uadmin:password -v http://localhost:8088/artifactory/api/pypi/pypi-remote/packages/86/e1/9cde84acb81b2071ebbf490002cb541ad33c52b18c792dfc38321abe7d4a/stripe-1.55.1.tar.gz > /dev/null -H 'If-None-Match: de06e25c9538911caba7164aef1b48cd6a8895cb'
        % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                       Dload  Upload   Total   Spent    Left  Speed
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0*   Trying ::1...
      * TCP_NODELAY set
      * Connected to localhost (::1) port 8088 (#0)
      * Server auth using Basic with user 'admin'
      > GET /artifactory/api/pypi/pypi-remote/packages/86/e1/9cde84acb81b2071ebbf490002cb541ad33c52b18c792dfc38321abe7d4a/stripe-1.55.1.tar.gz HTTP/1.1
      > Host: localhost:8088
      > Authorization: Basic YWRtaW46cGFzc3dvcmQ=
      > User-Agent: curl/7.54.0
      > Accept: */*
      > If-None-Match: de06e25c9538911caba7164aef1b48cd6a8895cb
      > 
      < HTTP/1.1 200 OK
      < Server: Artifactory/5.2.1
      < X-Artifactory-Id: de448c696d32e70c:7918e7e8:15bf433890b:-8000
      < Last-Modified: Wed, 10 May 2017 20:42:42 GMT
      < ETag: de06e25c9538911caba7164aef1b48cd6a8895cb
      < X-Checksum-Sha1: de06e25c9538911caba7164aef1b48cd6a8895cb
      < Accept-Ranges: bytes
      < X-Checksum-Md5: 0fd6311ea0a2ed40d41cf733de53787e
      < X-Artifactory-Filename: stripe-1.55.1.tar.gz
      < Content-Disposition: attachment; filename="stripe-1.55.1.tar.gz"; filename*=UTF-8''stripe-1.55.1.tar.gz
      < Content-Type: application/x-gzip
      < Content-Length: 189588
      < Date: Wed, 10 May 2017 22:15:44 GMT
      < 
      { [16384 bytes data]
      100  185k  100  185k    0     0  27.2M      0 --:--:-- --:--:-- --:--:-- 30.1M
      * Connection #0 to host localhost left intact
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                rotemk Rotem Kfir
                Reporter:
                travisf Travis Foster
              • Votes:
                1 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: