https://pulp.plan.io/https://pulp.plan.io/favicon.ico2020-02-28T15:38:16ZPulpAnsible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=535752020-02-28T15:38:16Zfao89
<ul><li><strong>Triaged</strong> changed from <i>No</i> to <i>Yes</i></li><li><strong>Sprint</strong> set to <i>Sprint 67</i></li></ul> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=537542020-03-04T17:56:01Zfao89
<ul><li><strong>Status</strong> changed from <i>NEW</i> to <i>ASSIGNED</i></li><li><strong>Assignee</strong> set to <i>fao89</i></li></ul> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=537592020-03-04T19:34:26Zfao89
<ul></ul><p>I tested it out and it seems to be delivering Content-Disposition:</p>
<pre><code class="text syntaxhl" data-language="text">(pulp) [vagrant@pulp3-source-fedora30 pulp_file]$ http http://pulp3-source-fedora30.localhost.example.com/pulp/content/d25030e3-cfdd-4b48-9b15-f3c5fd7e8767/1.iso
HTTP/1.1 302 Found
Connection: keep-alive
Content-Length: 10
Content-Type: text/plain; charset=utf-8
Date: Wed, 04 Mar 2020 18:39:58 GMT
Location: http://localhost:9000/pulp3/artifact/02/77b750a47e23de8a391ca5ccfa00e8dbb19419814a229d31f1d7ba382783d2?response-content-disposition=attachment%3Bfilename%3D1.iso&X-Amz-Algorithm=A$
S4-HMAC-SHA256&X-Amz-Credential=AKIAIT2Z5TDYPX3ARJBA/20200304/eu-central-1/s3/aws4_request&X-Amz-Date=20200304T183958Z&X-Amz-Expires=3600&X-Amz-SignedHeaders=host&X-Amz-Signature=e8eae4f9f1$1bd0288a1970e4f7a188be4f69c6d443a1a76a1e1e59b333c0d5b
Server: nginx/1.16.1
302: Found
(pulp) [vagrant@pulp3-source-fedora30 pulp_file]$ http --follow http://pulp3-source-fedora30.localhost.example.com/pulp/content/d25030e3-cfdd-4b48-9b15-f3c5fd7e8767/1.iso
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Disposition: attachment;filename=1.iso
Content-Length: 1024
Content-Security-Policy: block-all-mixed-content
Content-Type: application/octet-stream
Date: Wed, 04 Mar 2020 18:40:03 GMT
ETag: "4a0a5bb0213434a6d1201dfed4a8794a"
Last-Modified: Wed, 04 Mar 2020 18:37:27 GMT
Server: MinIO/RELEASE.2020-02-27T00-23-05Z
Vary: Origin
X-Amz-Request-Id: 15F92DE48BA99B36
X-Xss-Protection: 1; mode=block
+-----------------------------------------+
| NOTE: binary data not shown in terminal |
+-----------------------------------------+
(pulp) [vagrant@pulp3-source-fedora30 pulp_file]$ http -d http://pulp3-source-fedora30.localhost.example.com/pulp/content/d25030e3-cfdd-4b48-9b15-f3c5fd7e8767/1.iso
HTTP/1.1 200 OK
Accept-Ranges: bytes
Content-Disposition: attachment;filename=1.iso
Content-Length: 1024
Content-Security-Policy: block-all-mixed-content
Content-Type: application/octet-stream
Date: Wed, 04 Mar 2020 18:40:14 GMT
ETag: "4a0a5bb0213434a6d1201dfed4a8794a"
Last-Modified: Wed, 04 Mar 2020 18:37:27 GMT
Server: MinIO/RELEASE.2020-02-27T00-23-05Z
Vary: Origin
X-Amz-Request-Id: 15F92DE7093849EA
X-Xss-Protection: 1; mode=block
Downloading 1.00 kB to "1.iso"
Done. 1.00 kB in 0.00043s (2.29 MB/s)
</code></pre>
<p>But from here I can see Content-Disposition is set based on relative_path:
<a href="https://github.com/pulp/pulpcore/blob/master/pulpcore/content/handler.py#L558-L559" class="external">https://github.com/pulp/pulpcore/blob/master/pulpcore/content/handler.py#L558-L559</a></p>
<pre><code class="python syntaxhl" data-language="python"><span class="n">content_disposition</span> <span class="o">=</span> <span class="sa">f</span><span class="s">'attachment;filename=</span><span class="si">{</span><span class="n">content_artifact</span><span class="p">.</span><span class="n">relative_path</span><span class="si">}</span><span class="s">'</span>
</code></pre>
<p>from my test, it worked with 1.iso because:</p>
<pre><code class="python syntaxhl" data-language="python"><span class="n">In</span> <span class="p">[</span><span class="mi">1</span><span class="p">]:</span> <span class="p">[</span><span class="n">o</span><span class="p">.</span><span class="n">relative_path</span> <span class="k">for</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">ContentArtifact</span><span class="p">.</span><span class="n">objects</span><span class="p">.</span><span class="nb">all</span><span class="p">()]</span>
<span class="n">Out</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span> <span class="p">[</span><span class="s">'1.iso'</span><span class="p">,</span> <span class="s">'2.iso'</span><span class="p">,</span> <span class="s">'3.iso'</span><span class="p">,</span> <span class="s">'PULP_MANIFEST'</span><span class="p">]</span>
</code></pre> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=537602020-03-04T19:41:26Zbmbouterbmbouter@redhat.com
<ul></ul><p>Maybe uploading the content instead causes it to be entered in the db differently? Does content created from <a href="https://github.com/pulp/pulp_ansible/blob/master/pulp_ansible/tests/functional/cli/test_collection_upload.py#L36" class="external">this test</a> also have the file extension in the db?</p> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=537622020-03-04T20:02:00Zfao89
<ul></ul><p>you were right, for that test:</p>
<pre><code class="python syntaxhl" data-language="python"><span class="n">In</span> <span class="p">[</span><span class="mi">1</span><span class="p">]:</span> <span class="p">[</span><span class="n">o</span><span class="p">.</span><span class="n">relative_path</span> <span class="k">for</span> <span class="n">o</span> <span class="ow">in</span> <span class="n">ContentArtifact</span><span class="p">.</span><span class="n">objects</span><span class="p">.</span><span class="nb">all</span><span class="p">()]</span>
<span class="n">Out</span><span class="p">[</span><span class="mi">1</span><span class="p">]:</span> <span class="p">[</span><span class="s">'pulp.nvymlldlmyekgkkdnnhrbpybwo.1.0.0'</span><span class="p">]</span>
</code></pre> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=537642020-03-04T20:22:08Zbmbouterbmbouter@redhat.com
<ul></ul><p>That is great! Can that be fixed, and also an assertion added on it being correct in the tests maybe?</p>
<p>Also I think it needs a database migration since the code is in production on automation hub already. Would you be willing to add a database migration also? Let me know if you want to collaborate on how to write that or test it.</p> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=537662020-03-04T21:04:41Zfao89
<ul><li><strong>Status</strong> changed from <i>ASSIGNED</i> to <i>POST</i></li></ul><p><a href="https://github.com/pulp/pulp_ansible/pull/294" class="external">https://github.com/pulp/pulp_ansible/pull/294</a></p> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=538392020-03-06T15:09:57Zrchan
<ul><li><strong>Sprint</strong> changed from <i>Sprint 67</i> to <i>Sprint 68</i></li></ul> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=538702020-03-06T18:59:02ZAnonymous
<ul><li><strong>Status</strong> changed from <i>POST</i> to <i>MODIFIED</i></li></ul><p>Applied in changeset <a class="changeset" title="Including file type extension https://pulp.plan.io/issues/6223 closes #6223" href="https://pulp.plan.io/projects/ansible_plugin/repository/pulp_ansible/revisions/9c32bd0279186c6134dbcb20bb1e784990f545ae">ansible_plugin:pulp_ansible|9c32bd0279186c6134dbcb20bb1e784990f545ae</a>.</p> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=546642020-04-01T20:47:28Zdaviddavis
<ul><li><strong>Project</strong> changed from <i>Pulp</i> to <i>Ansible Plugin</i></li></ul> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=609942020-08-17T17:52:25Zfao89
<ul><li><strong>Sprint/Milestone</strong> set to <i>0.2.0</i></li></ul> Ansible Plugin - Issue #6223: Pulp configured with S3 doesn't include file type extension in Content-Disposition headerhttps://pulp.plan.io/issues/6223?journal_id=628502020-09-23T20:01:57Zbmbouterbmbouter@redhat.com
<ul><li><strong>Status</strong> changed from <i>MODIFIED</i> to <i>CLOSED - CURRENTRELEASE</i></li></ul>